From b74c052b43d7c4a830386940a036eb7c2ec9abc2 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期二, 14 一月 2020 13:37:26 +0800
Subject: [PATCH] 2020-1-14-01

---
 ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs |  101 +++++++++++++++++++++++++++++++-------------------
 1 files changed, 62 insertions(+), 39 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs
index 0bb6882..9231d7a 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs
@@ -109,7 +109,7 @@
                 Height = Application.GetRealHeight(436),
                 X = Application.GetRealWidth(72),
                 Y = Application.GetRealHeight(30),
-                UnSelectedImagePath = "ZigeeLogic/logicbj" + s + ".png",
+                UnSelectedImagePath = $"ZigeeLogic/logicbj{s}.png",
             };
             logiciconfl.AddChidren(iconBtn);
 
@@ -298,11 +298,11 @@
                     var addtextbtn = new Button
                     {
                         Height = Application.GetRealHeight(58),
-                        Width = Application.GetRealWidth(300),
+                        Width = Application.GetRealWidth(400),
                         Y = Application.GetRealHeight(45 + 30),
                         TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
                         TextID = MyInternationalizationString.addsensor,
-                        X = Application.GetRealWidth(390),
+                        X = Application.GetRealWidth(340),
                         TextSize = 14,
                     };
                     addfl.AddChidren(addtextbtn);
@@ -494,21 +494,18 @@
 
                     del.MouseUpEventHandler += (sender, e) =>
                     {
-
-                        var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete),
-                                              Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim));
-                        alert.ResultEventHandler += (sender1, e1) =>
-                        {
-                            if (e1)
-                            {
-                                Common.Logic.CurrentLogic.Conditions.Remove(conditions);
-                                var templatePage = new TemplatePage();
-                                UserView.HomePage.Instance.AddChidren(templatePage);
-                                UserView.HomePage.Instance.PageIndex += 1;
-                                templatePage.Show();
-                            }
-                        };
+                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
+                       Language.StringByID(MyInternationalizationString.doyouwanttodelete),
+                       Language.StringByID(MyInternationalizationString.confrim));
                         alert.Show();
+                        alert.ConfirmClickEvent += () =>
+                        {
+                            Common.Logic.CurrentLogic.Conditions.Remove(conditions);
+                            var templatePage = new TemplatePage();
+                            UserView.HomePage.Instance.AddChidren(templatePage);
+                            UserView.HomePage.Instance.PageIndex += 1;
+                            templatePage.Show();
+                        };
 
                     };
 
@@ -612,11 +609,11 @@
                     var addtextbtn = new Button
                     {
                         Height = Application.GetRealHeight(58),
-                        Width = Application.GetRealWidth(300),
+                        Width = Application.GetRealWidth(400),
                         Y = Application.GetRealHeight(45 + 30),
                         TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
                         TextID = MyInternationalizationString.addlighting,
-                        X = Application.GetRealWidth(390),
+                        X = Application.GetRealWidth(340),
                         TextSize = 14,
                     };
                     addfl.AddChidren(addtextbtn);
@@ -996,20 +993,19 @@
 
                     del.MouseUpEventHandler += (sender, e) =>
                     {
-                        var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete),
-                                               Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim));
-                        alert.ResultEventHandler += (sender1, e1) =>
-                        {
-                            if (e1)
-                            {
-                                Common.Logic.CurrentLogic.Actions.Remove(actions);
-                                var templatePage = new TemplatePage();
-                                UserView.HomePage.Instance.AddChidren(templatePage);
-                                UserView.HomePage.Instance.PageIndex += 1;
-                                templatePage.Show();
-                            }
-                        };
+                     
+                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
+                     Language.StringByID(MyInternationalizationString.doyouwanttodelete),
+                     Language.StringByID(MyInternationalizationString.confrim));
                         alert.Show();
+                        alert.ConfirmClickEvent += () =>
+                        {
+                            Common.Logic.CurrentLogic.Actions.Remove(actions);
+                            var templatePage = new TemplatePage();
+                            UserView.HomePage.Instance.AddChidren(templatePage);
+                            UserView.HomePage.Instance.PageIndex += 1;
+                            templatePage.Show();
+                        };
 
                     };
 
@@ -1195,18 +1191,38 @@
 
             #endregion
 
+            bool tag = false;//鏍囪寮�鍏崇姸鎬�;
             btnswitch.MouseUpEventHandler += (sender1, e1) =>
             {
                 btnswitch.IsSelected = !btnswitch.IsSelected;
                 if (btnswitch.IsSelected)
                 {
+                    tag = true;
                     custompushFrameLayout.Height = Application.GetRealHeight(160);
+                    Common.Logic.CurrentLogic.LogicIsCustomPushText = 1;
+
                 }
                 else
                 {
+                    tag = false;
                     custompushFrameLayout.Height = Application.GetRealHeight(0);
+                    Common.Logic.CurrentLogic.LogicIsCustomPushText = 0;
+
                 }
+                Send.Zj(tag, Common.Logic.CurrentLogic);
             };
+            if (Common.Logic.CurrentLogic.LogicIsCustomPushText == 0)
+            {
+                tag = false;
+                btnswitch.IsSelected = false;
+                custompushFrameLayout.Height = Application.GetRealHeight(0);
+            }
+            else
+            {
+                tag = true;
+                btnswitch.IsSelected = true;
+                custompushFrameLayout.Height = Application.GetRealHeight(160);
+            }
             var saveFrameLayout = new FrameLayout
             {
                 Y = middle.Bottom,
@@ -1235,15 +1251,18 @@
                 //}
                 if (string.IsNullOrEmpty(logicTextBox.Text.Trim()))
                 {
-                    new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.PleaseEnterLogicName), Language.StringByID(MyInternationalizationString.Close)).Show();
+                    var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
+                      Language.StringByID(MyInternationalizationString.PleaseEnterLogicName),
+                      Language.StringByID(MyInternationalizationString.confrim));
+                    alert.Show();
                     return;
                 }
-                var logicname = Common.Logic.LogicList.Find((logic) => Common.Logic.CurrentLogic.LogicId != logic.LogicId && logic.LogicName == name);
-                if (logicname != null)
-                {
-                    new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.Rename), Language.StringByID(MyInternationalizationString.Close)).Show();
-                    return;
-                }
+                //var logicname = Common.Logic.LogicList.Find((logic) => Common.Logic.CurrentLogic.LogicId != logic.LogicId && logic.LogicName == name);
+                //if (logicname != null)
+                //{
+                //    new Alert(Language.StringByID(MyInternationalizationString.Tip), Language.StringByID(MyInternationalizationString.Rename), Language.StringByID(MyInternationalizationString.Close)).Show();
+                //    return;
+                //}
 
                 Common.Logic.CurrentLogic.LogicName = name;
 
@@ -1257,6 +1276,10 @@
                     {
                         Common.Logic.CurrentLogic.LogicId = logicifon.LogicId;
                         Common.Logic.LogicList.Add(Common.Logic.CurrentLogic);
+                        if (tag)
+                        {
+                            Send.Zj(tag, Common.Logic.CurrentLogic);
+                        }
                     }
                 }
                 else

--
Gitblit v1.8.0