From 8ee8336485e98ba9722c5feb1cafacd93c6b5c1a Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期三, 11 三月 2020 09:16:51 +0800
Subject: [PATCH] 2020-03-11-1

---
 ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs                           |   56 
 ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedDeviceView.cs        |  121 
 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddAction.cs             |  200 
 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs         |   63 
 ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs                   | 2090 ++--------
 ZigbeeApp/Shared/Phone/Device/Logic/TimePoint.cs                           |  660 --
 ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs                          |   56 
 ZigbeeApp/Shared/Phone/Device/Logic/Method.cs                              |  773 +++
 ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs                        |  191 
 ZigbeeApp/Shared/Phone/Device/Category/Category.cs                         |  271 -
 ZigbeeApp/Shared/Phone/Device/Logic/Send.cs                                |  104 
 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs          |  114 
 ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs                   |  452 ++
 ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TypeView.cs                  |   72 
 ZigbeeApp/Shared/Phone/Device/Logic/EverymonthPage.cs                      |   55 
 ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs                            |  296 -
 ZigbeeApp/Shared/Phone/Device/Logic/LogicView/CompleteView.cs              |   70 
 ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TopView.cs                   |  115 
 ZigbeeApp/Shared/Phone/Device/.DS_Store                                    |    0 
 ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs                               |   62 
 ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs                        |   79 
 ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs                        | 1195 +----
 ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs                          |   55 
 ZigbeeApp/Shared/Phone/Device/Logic/LogicView/mFunView.cs                  |   60 
 ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml                                     |   45 
 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs |  819 ---
 ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SaveView.cs                  |   36 
 ZigbeeApp/Shared/Phone/Device/Logic/LogicView/Addview.cs                   |   77 
 ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedButton.cs            |    0 
 ZigbeeApp/Shared/Shared.projitems                                          |   27 
 ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs                        |  358 -
 /dev/null                                                                  |  264 -
 ZigbeeApp/Shared/Phone/Device/Logic/LogicView/AddDeviceView.cs             |   49 
 ZigbeeApp/Shared/Phone/Device/Logic/LogicView/FunView.cs                   |   70 
 ZigbeeApp/Shared/Phone/Device/Logic/CustomText.cs                          |   56 
 ZigbeeApp/Shared/Phone/Device/Logic/LogicView/IfString.cs                  |   52 
 ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs                            |   57 
 ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs                  | 1315 ++++++
 ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs                        | 1541 ------
 39 files changed, 4,704 insertions(+), 7,272 deletions(-)

diff --git a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
index 069a22d..85c73bd 100644
--- a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
+++ b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
@@ -1,51 +1,16 @@
 锘�<Properties StartupConfiguration="{F1296E2C-3777-4385-85B2-DA77617E3178}|Default">
   <MonoDevelop.Ide.ItemProperties.GateWay.Droid PreferredExecutionTarget="Android.SelectDevice" />
   <MonoDevelop.Ide.ItemProperties.ShardLib PreferredExecutionTarget="Android.SelectDevice" />
-  <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/Logic/MemberList.cs">
+  <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/Category/Category.cs">
     <Files>
-      <File FileName="Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs" Line="135" Column="76" />
-      <File FileName="Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs" Line="413" Column="38" />
-      <File FileName="Shared/Phone/Device/Logic/MemberList.cs" Line="418" Column="60" />
-      <File FileName="Shared/Phone/Device/Logic/LogicCommunalPage.cs" Line="2048" Column="55" />
-      <File FileName="Shared/Phone/Device/Category/Category.cs" />
-      <File FileName="Shared/Phone/Device/Logic/Send.cs" Line="246" Column="1" />
-      <File FileName="Shared/Common/Logic.cs" />
-      <File FileName="Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs" Line="356" Column="123" />
+      <File FileName="Shared/Phone/Device/Category/Category.cs" Line="19" Column="9" />
     </Files>
-    <Pads>
-      <Pad Id="ProjectPad">
-        <State name="__root__">
-          <Node name="GateWay" expanded="True">
-            <Node name="GateWay.Droid" expanded="True">
-              <Node name="Assets" expanded="True" />
-            </Node>
-            <Node name="Home.IOS" expanded="True">
-              <Node name="Resources" expanded="True" />
-            </Node>
-            <Node name="Shared" expanded="True">
-              <Node name="Common" expanded="True" />
-              <Node name="Phone" expanded="True">
-                <Node name="Device" expanded="True">
-                  <Node name="Category" expanded="True" />
-                  <Node name="Logic" expanded="True">
-                    <Node name="DoorLockLogic" expanded="True" />
-                    <Node name="MemberList.cs" selected="True" />
-                  </Node>
-                </Node>
-              </Node>
-            </Node>
-          </Node>
-        </State>
-      </Pad>
-    </Pads>
   </MonoDevelop.Ide.Workbench>
-  <MonoDevelop.Ide.ItemProperties.Home.IOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.913cb77b0eef11c9119c61a02bc00fec01bf67d6" />
+  <MonoDevelop.Ide.ItemProperties.Home.IOS automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.9992EB40-E6DD-48F4-AFED-CEB5E811ACDD" />
   <MonoDevelop.Ide.DebuggingService.PinnedWatches />
-  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
+  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhoneSimulator" />
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
-    <BreakpointStore>
-      <Breakpoint file="/Users/hdl/Desktop/HomeApp/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs" relfile="Shared/Phone/Device/Logic/Send.cs" line="524" column="1" />
-    </BreakpointStore>
+    <BreakpointStore />
   </MonoDevelop.Ide.DebuggingService.Breakpoints>
   <MultiItemStartupConfigurations />
 </Properties>
\ No newline at end of file
diff --git a/ZigbeeApp/Shared/Phone/Device/.DS_Store b/ZigbeeApp/Shared/Phone/Device/.DS_Store
index 5bcd917..51cc315 100644
--- a/ZigbeeApp/Shared/Phone/Device/.DS_Store
+++ b/ZigbeeApp/Shared/Phone/Device/.DS_Store
Binary files differ
diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
index a55530b..84db891 100644
--- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -1746,20 +1746,23 @@
         /// 鑷姩鍖栧姛鑳戒唬鐮佸叆鍙�
         /// </summary>
         private  void ShowAutotion()
-        {
-           // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-           
+        {
+            // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
+            #region   ---鎺ㄨ崘妯℃澘鐨勭粍浠�
+            //鎺ㄨ崘妯℃澘鑳屾櫙鎺т欢
             var bjFrameLayout = new FrameLayout
             {
                 Width = Application.GetRealWidth(1080 - 58),
                 Height = Application.GetRealHeight(170),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
+                BackgroundColor =ZigbeeColor.Current.LogicBackgroundColor,
                 X = Application.GetRealWidth(58),
                 //Radius = (uint)Application.GetRealHeight(50),
                 Y = Application.GetRealHeight(30),
+                
             };
             functionSceneAutoBodyView.AddChidren(bjFrameLayout);
             bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
+            //鍥炬爣鎺т欢
             var sigBtn = new Button
             {
                 Width = Application.GetMinRealAverage(84),
@@ -1769,7 +1772,7 @@
                 Gravity = Gravity.CenterVertical,
             };
             bjFrameLayout.AddChidren(sigBtn);
-
+            //鎺ㄨ崘妯℃澘鏂囨湰鎺т欢
             var recommendtextBtn = new Button
             {
                 Width = Application.GetMinRealAverage(300),
@@ -1783,7 +1786,7 @@
                 TextSize = 15,
             };
             bjFrameLayout.AddChidren(recommendtextBtn);
-
+            //鎺ㄨ崘妯℃澘寮�鍏虫帶浠�
             var recommendswitchBtn = new Button
             {
                 Width = Application.GetMinRealAverage(104),
@@ -1794,8 +1797,8 @@
                 Gravity = Gravity.CenterVertical,
             };
             bjFrameLayout.AddChidren(recommendswitchBtn);
-
-
+            #endregion
+            //榛樿鎺ㄨ崘妯℃澘宸﹀彸鍙粦鎺т欢
             var scenehorizontalScrol = new HorizontalScrolViewLayout
             {
                 Width = Application.GetRealWidth(1080 - 58),
@@ -1804,7 +1807,7 @@
                 Height = Application.GetRealHeight(0),
             };
             functionSceneAutoBodyView.AddChidren(scenehorizontalScrol);
-
+            //鏄剧ず鑷姩鍖栧垪琛ㄤ笂涓嬪彲婊戞帶浠�
             var logicScrolView = new VerticalRefreshLayout//VerticalScrolViewLayout
             {
                 Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30),
@@ -1815,6 +1818,7 @@
             functionSceneAutoBodyView.AddChidren(logicScrolView);
             logicScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
             bool no = false;
+            //鏄剧ず榛樿妯℃澘鐨勭晫闈簨浠�
             recommendswitchBtn.MouseUpEventHandler += (sender, e) =>
             {
                 int Yheight = 0;
@@ -1908,6 +1912,7 @@
                 logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight;
                 Automationview(logicScrolView,no);
             };
+            //涓嬫媺鍒锋柊鑷姩鍖栧垪琛ㄧ殑浜嬩欢
             logicScrolView.BeginHeaderRefreshingAction += () =>
             {
                 //閲嶆柊鍒锋柊logic鍒楄〃
@@ -2153,254 +2158,8 @@
             logicRowlayout.AddChidren(logictimeBtn);
 
             ///鏄剧ず鎵ц鍛ㄦ湡
-            switch (logic.TimeAttribute.Repeat)
-            {
-                ///0:鍙墽琛屼竴娆★紝鎵ц鍚嶪sEnable鍊肩疆;1,浠婂勾鍐呮墽琛�;2锛氭瘡澶╂墽琛�;3锛氭瘡鏈堟墽琛�;4锛氭瘡骞存墽琛�;5锛氬懆閲嶅銆�
-                case 0:
-                    {
-                        logictimeBtn.Text = Language.StringByID(MyInternationalizationString.executeonce);
-                    }; break;
-                case 1: { }; break;
-                case 2:
-                    {
-                        logictimeBtn.Text = Language.StringByID(MyInternationalizationString.everyday);
-                    }; break;
-                case 3:
-                    {
+            Logic.Method.UpdateWeek(logictimeBtn,logic);
 
-                        string len = "", value = "";
-                        var stringvalue = Convert.ToString(logic.TimeAttribute.MonthDate, 2);
-                        var str = stringvalue.Insert(0, new string('0', 32 - stringvalue.Length));
-                        for (int j = 31; j >= 0; j--)
-                        {
-                            len += str.Substring(j, 1);
-                        }
-                        for (int j = 0; j < len.Length; j++)
-                        {
-                            var strvalue = len.Substring(j, 1);
-                            if (strvalue == "1")
-                            {
-                                value += (j + 1).ToString() + ",";
-                            }
-                        }
-                        logictimeBtn.Text = Language.StringByID(MyInternationalizationString.monthly) + value.TrimEnd(',') + Language.StringByID(MyInternationalizationString.day);
-
-                    }; break;
-                case 4:
-                    {
-
-                        Dictionary<int, int> dictionary = new Dictionary<int, int>();
-                        ///鎵惧嚭鎵ц鐨勬湀浠藉拰澶╂暟
-                        if (logic.TimeAttribute.SelectMonDate.Count != 0)
-                        {
-                            for (int i = 0; i < logic.TimeAttribute.SelectMonDate.Count; i++)
-                            {
-                                var dayvalue = logic.TimeAttribute.SelectMonDate[i];
-                                if (dayvalue != 0)
-                                {
-                                    dictionary.Add(i + 1, dayvalue);
-                                }
-                            }
-                        }
-                        if (dictionary.Count != 0 && dictionary.Count == 1)
-                        {
-                            string len = "", leng = "";
-                            int minvalue = 0, Maximum = 0;
-                            foreach (var value in dictionary)
-                            {
-                                ///鍙栧嚭鏈堜唤
-                                var month = value.Key;
-                                ///鍙栧嚭鏃ユ暟
-                                var day = value.Value;
-                                var maxvalue = Convert.ToString(day, 2);
-                                var str = maxvalue.Insert(0, new string('0', 32 - maxvalue.Length));
-                                for (int j = 31; j >= 0; j--)
-                                {
-                                    len += str.Substring(j, 1);
-                                }
-
-                                for (int j = 0; j < len.Length; j++)
-                                {
-                                    var strvalue = len.Substring(j, 1);
-                                    if (strvalue == "1")
-                                    {
-                                        minvalue = j + 1;
-                                        break;
-                                    }
-                                }
-                                for (int j = 0; j < len.Length; j++)
-                                {
-                                    var strvalue = len.Substring(j, 1);
-                                    if (strvalue == "1")
-                                    {
-                                        Maximum = j + 1;
-                                    }
-                                }
-
-                                if (month.ToString().Length < 2)
-                                {
-                                    leng = "0" + month.ToString();
-                                }
-                                else
-                                {
-                                    leng = month.ToString();
-                                }
-                                if (minvalue == Maximum)
-                                {
-                                    logictimeBtn.Text = Language.StringByID(MyInternationalizationString.everyyear) + leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString());
-                                }
-                                else
-                                {
-                                    logictimeBtn.Text = Language.StringByID(MyInternationalizationString.everyyear) + leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString()) + "-" + leng + "/" + (Maximum.ToString().Length < 2 ? "0" + Maximum.ToString() : Maximum.ToString());
-                                }
-                            }
-
-                        }
-                        else
-                        {
-                            int b = 0;
-                            string stringtext = "";
-                            foreach (var value in dictionary)
-                            {
-                                string len = "", leng = "";
-                                int minvalue = 0, Maximum = 0;
-                                ///鍙栧嚭鏈堜唤
-                                var month = value.Key;
-                                ///鍙栧嚭鏃ユ暟
-                                var day = value.Value;
-                                var maxvalue = Convert.ToString(day, 2);
-                                var str = maxvalue.Insert(0, new string('0', 32 - maxvalue.Length));
-                                for (int j = 31; j >= 0; j--)
-                                {
-                                    len += str.Substring(j, 1);
-                                }
-
-
-                                if (month.ToString().Length < 2)
-                                {
-                                    leng = "0" + month.ToString();
-                                }
-                                else
-                                {
-                                    leng = month.ToString();
-                                }
-
-
-
-                                if (b == 0)
-                                {
-                                    for (int j = 0; j < len.Length; j++)
-                                    {
-                                        var strvalue = len.Substring(j, 1);
-                                        if (strvalue == "1")
-                                        {
-                                            minvalue = j + 1;
-                                            break;
-                                        }
-                                    }
-                                    stringtext += leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString()) + "-";
-
-                                }
-
-                                if (b == dictionary.Count - 1)
-                                {
-                                    for (int j = 0; j < len.Length; j++)
-                                    {
-                                        var strvalue = len.Substring(j, 1);
-                                        if (strvalue == "1")
-                                        {
-                                            Maximum = j + 1;
-                                        }
-                                    }
-                                    stringtext += leng + "/" + (Maximum.ToString().Length < 2 ? "0" + Maximum.ToString() : Maximum.ToString());
-
-                                }
-                                b++;
-                            }
-                            logictimeBtn.Text = Language.StringByID(MyInternationalizationString.everyyear) + stringtext;
-                        }
-
-                    }; break;
-                case 5:
-                    {
-                        string len = "", text = "";
-                        List<int> listvalueInt = new List<int>();
-                        listvalueInt.Clear();
-                        var maxvalue = Convert.ToString(logic.TimeAttribute.WeekDay, 2);
-                        var str = maxvalue.Insert(0, new string('0', 8 - maxvalue.Length));
-                        for (int j = 7; j >= 0; j--)
-                        {
-                            len += str.Substring(j, 1);
-                        }
-
-                        for (int j = 0; j < len.Length; j++)
-                        {
-                            var strvalue = len.Substring(j, 1);
-                            if (strvalue == "1")
-                            {
-                                listvalueInt.Add(j + 1);
-
-
-                                if ((j + 1) == 1)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.mon1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.mon) + ",";
-                                }
-                                else if ((j + 1) == 2)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.tue1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.tue) + ",";
-                                }
-                                else if ((j + 1) == 3)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.wed1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.wed) + ",";
-                                }
-                                else if ((j + 1) == 4)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.thu1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.thu) + ",";
-                                }
-                                else if ((j + 1) == 5)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.frl1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.frl) + ",";
-                                }
-                                else if ((j + 1) == 6)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.sat1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.sat) + ",";
-                                }
-                                else if ((j + 1) == 7)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.sun1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.sun) + ",";
-                                }
-
-
-                            }
-                        }
-                        //鏆傛椂闅愯棌鎺夛紝闇�瑕佹樉绀哄懆鏈拰宸ヤ綔鏃ュ啀鏀惧紑锛�
-                        //if (listvalueInt.Count == 5 && !listvalueInt.Contains(6) && !listvalueInt.Contains(7))
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.workingday);
-                        //}
-                        //else if (listvalueInt.Count == 2 && listvalueInt.Contains(6) && listvalueInt.Contains(7))
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.weekend);
-                        //}
-                        //else if (listvalueInt.Count == 7)
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.everyday);
-                        //}
-                        //else
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.week1) + text.Replace(Language.StringByID(MyInternationalizationString.week1), "").TrimEnd(',');
-                        //}
-                        logictimeBtn.Text = Language.StringByID(MyInternationalizationString.week1) + text.Replace(Language.StringByID(MyInternationalizationString.week1), "").TrimEnd(',');
-                        //btndisplaycycle.Text = text.TrimEnd(',');
-                    }; break;
-            }
 
             List<string> indexlist = new List<string>();
             List<string> iconIndexlist = new List<string>();
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
index 7751fe6..53eb7f4 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
@@ -1,14 +1,15 @@
-锘�       using System;
+锘縰sing System;
 using System.Collections.Generic;
 using Shared;
 using Shared.Common;
 using Shared.Phone.Device;
 using Shared.R;
 using ZigBee.Device;
+using Shared.Phone.Device.Logic.LogicView;
 
 namespace Shared.Phone.Device.Logic
 {
-    
+
     public class AddLogicPage : FrameLayout
     {
         public AddLogicPage()
@@ -17,357 +18,73 @@
         }
         public void Show()
         {
-
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.selection,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent();
-            };
+            #region  涓婇潰鐨勫竷灞�浠g爜
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.TextID = MyInternationalizationString.selection;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             #endregion
-
             #region  鏈�涓嬮潰鐨勫竷灞�浠g爜
-            var middle = new FrameLayout {
-                Y = topRowLayout.Bottom,
+            var middle = new FrameLayout
+            {
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
-
-            #region   ----鏃堕棿鏉′欢----
-            var timeframelayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(timeframelayout);
-
-
-            var timeiconBtn = new Button
-            {
-                Width = Application.GetRealWidth(81),
-                Height = Application.GetRealHeight(81),
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-                UnSelectedImagePath = "ZigeeLogic/time.png",
-
-            };
-            timeframelayout.AddChidren(timeiconBtn);
-
-            var timerow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            timeframelayout.AddChidren(timerow);
-            ///鏃堕棿鏉′欢
-            var btntime = new Button {
-                Text = Language.StringByID(MyInternationalizationString.timecondition),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize=15,
-            };
-            timerow.AddChidren(btntime);
-
-            var btntimeback = new Button {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = Application.GetRealWidth(789),
-                Gravity = Gravity.CenterVertical,
-            };
-            timerow.AddChidren(btntimeback);
-
-            EventHandler<MouseEventArgs> timeclick = (sender, e) =>
+            ///鏃堕棿
+            FunView timeview = new FunView();
+            timeview.iconBtn.UnSelectedImagePath = "ZigeeLogic/time.png";
+            timeview.funnameBtn.TextID = MyInternationalizationString.timecondition;
+            middle.AddChidren(timeview.FunFrameView());
+            timeview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
                 TimeView();
             };
-            btntime.MouseUpEventHandler += timeclick;
-            btntimeback.MouseUpEventHandler += timeclick;
-            timeframelayout.MouseUpEventHandler += timeclick;
-            timeiconBtn.MouseUpEventHandler += timeclick;
-            timerow.MouseUpEventHandler += timeclick;
-
-            #endregion
-
-            #region   ----璁惧鐘舵�佹潯浠�----
-            var deviceframelayout = new FrameLayout
+            ///璁惧
+            FunView functionview = new FunView();
+            functionview.funFrameLayout.Y = timeview.funFrameLayout.Bottom;
+            functionview.iconBtn.UnSelectedImagePath = "ZigeeLogic/function.png";
+            functionview.funnameBtn.TextID = MyInternationalizationString.device;
+            middle.AddChidren(functionview.FunFrameView());
+            functionview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                Y = timeframelayout.Bottom,
-            };
-            middle.AddChidren(deviceframelayout);
-
-            var deviceiconBtn = new Button
-            {
-                Width = Application.GetRealWidth(81),
-                Height = Application.GetRealHeight(81),
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-                UnSelectedImagePath = "ZigeeLogic/function.png",
-
-            };
-            deviceframelayout.AddChidren(deviceiconBtn);
-
-            var devicerow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            deviceframelayout.AddChidren(devicerow);
-
-
-            ///璁惧鐘舵�佹潯浠�
-            var btndevice = new Button {
-                //Text = "璁惧鐘舵�佹潯浠�",
-                TextID = MyInternationalizationString.device,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-            };
-            devicerow.AddChidren(btndevice);
-
-            var btndeviceback = new Button {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                X = Application.GetRealWidth(789),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-
-            };
-            devicerow.AddChidren(btndeviceback);
-
-            EventHandler<MouseEventArgs> devicestateclick = (sender, e) =>
-            {
-                var deviceStateCondition = new DeviceStateCondition();
-                UserView.HomePage.Instance.AddChidren(deviceStateCondition);
+                var roomAndDeviceView = new RoomAndDeviceView();
+                UserView.HomePage.Instance.AddChidren(roomAndDeviceView);
                 UserView.HomePage.Instance.PageIndex += 1;
-                deviceStateCondition.Show();
+                roomAndDeviceView.IfType = LogicView.IfString.Condition_Logic;
+                roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.devicestate));
             };
-            deviceframelayout.MouseUpEventHandler += devicestateclick;
-            btndevice.MouseUpEventHandler += devicestateclick;
-            btndeviceback.MouseUpEventHandler += devicestateclick;
-            deviceiconBtn.MouseUpEventHandler += devicestateclick;
-            devicerow.MouseUpEventHandler += devicestateclick;
-            #endregion
-
-            #region   ----瀹夐槻鏉′欢----
-            var securityframelayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = deviceframelayout.Bottom,
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(securityframelayout);
-
-            var securityiconBtn = new Button
-            {
-                Width = Application.GetRealWidth(81),
-                Height = Application.GetRealHeight(81),
-                UnSelectedImagePath = "ZigeeLogic/security.png",
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-            };
-            securityframelayout.AddChidren(securityiconBtn);
-
-            var securityrow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            securityframelayout.AddChidren(securityrow);
-
-
-            var btnsecurity = new Button
-            {
-                //Text = "瀹夐槻鏉′欢",
-                TextAlignment = TextAlignment.CenterLeft,
-                TextID = MyInternationalizationString.security,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-            };
-            securityrow.AddChidren(btnsecurity);
-
-            var btnsecurityback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = Application.GetRealWidth(789),
-                Gravity = Gravity.CenterVertical,
-            };
-            securityrow.AddChidren(btnsecurityback);
-
-            EventHandler<MouseEventArgs> securityclick = (sender, e) =>
+            ///瀹夐槻
+            FunView securityview = new FunView();
+            securityview.funFrameLayout.Y = functionview.funFrameLayout.Bottom;
+            securityview.iconBtn.UnSelectedImagePath = "ZigeeLogic/security.png";
+            securityview.funnameBtn.TextID = MyInternationalizationString.security;
+            middle.AddChidren(securityview.FunFrameView());
+            securityview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
                 var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
                 this.AddChidren(flMain);
                 SecurityView(flMain, false);
             };
-            securityframelayout.MouseUpEventHandler += securityclick;
-            btnsecurity.MouseUpEventHandler += securityclick;
-            btnsecurityback.MouseUpEventHandler += securityclick;
-            securityiconBtn.MouseUpEventHandler += securityclick;
-            securityrow.MouseUpEventHandler += securityclick;
-            #endregion
-
-            #region   ----鍦扮悊鍥存爮鏉′欢----
-            var locationframelayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = securityframelayout.Bottom,
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(locationframelayout);
-
-            var locationiconBtn = new Button
-            {
-                Width = Application.GetRealWidth(81),
-                Height = Application.GetRealHeight(81),
-                UnSelectedImagePath = "ZigeeLogic/position.png",
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-            };
-            locationframelayout.AddChidren(locationiconBtn);
-
-            var locationrow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            locationframelayout.AddChidren(locationrow);
-
-            var btnlocation = new Button
-            {
-                TextAlignment = TextAlignment.CenterLeft,
-                TextID = MyInternationalizationString.location,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-            };
-            locationrow.AddChidren(btnlocation);
-
-            var btnlocationback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = Application.GetRealWidth(789),
-                Gravity = Gravity.CenterVertical,
-            };
-            locationrow.AddChidren(btnlocationback);
-
-            EventHandler<MouseEventArgs> locationclick = (sender, e) =>
+            ///鍦扮悊鍥存爮
+            FunView positionview = new FunView();
+            positionview.funFrameLayout.Y = securityview.funFrameLayout.Bottom;
+            positionview.iconBtn.UnSelectedImagePath = "ZigeeLogic/position.png";
+            positionview.funnameBtn.TextID = MyInternationalizationString.location;
+            positionview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
+            middle.AddChidren(positionview.FunFrameView());
+            positionview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
                 var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
                 this.AddChidren(flMain);
                 LocationView(flMain, false);
             };
-            locationframelayout.MouseUpEventHandler += locationclick;
-            locationiconBtn.MouseUpEventHandler += locationclick;
-            locationrow.MouseUpEventHandler += locationclick;
-            btnlocation.MouseUpEventHandler += locationclick;
-            btnlocationback.MouseUpEventHandler += locationclick;
-            #endregion
-
-            #region   ----宸叉湁鑷姩鍖栨潯浠�----
-            var existencerowlayout = new RowLayout {
-                Height = Application.GetRealHeight(180),
-                Y = securityframelayout.Bottom,
-            };
-            //middle.AddChidren (existencerowlayout);
-            ///宸叉湁鑷姩鍖栨潯浠�
-            var btnexistence = new Button
-            {
-                //Text = "宸叉湁鑷姩鍖栨潯浠�",
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(60),
-                TextID = MyInternationalizationString.automation,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-            };
-            existencerowlayout.AddChidren(btnexistence);
-
-            var btnexistenceback = new Button {
-                Width = Application.GetRealWidth(110),
-                Height = Application.GetRealHeight(110),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                SelectedImagePath = "ZigeeLogic/NextSelecte.png",
-                X = Application.GetRealWidth(1080 - 140),
-                Gravity = Gravity.CenterVertical,
-            };
-            existencerowlayout.AddChidren(btnexistenceback);
-
-            EventHandler<MouseEventArgs> logicclick = (sender, e) => {
-                var logicListAutomation = new LogicListAutomation();
-                UserView.HomePage.Instance.AddChidren(logicListAutomation);
-                UserView.HomePage.Instance.PageIndex += 1;
-                logicListAutomation.Show();
-            };
-            btnexistenceback.MouseUpEventHandler += logicclick;
-            btnexistence.MouseUpEventHandler += logicclick;
-            existencerowlayout.MouseUpEventHandler += logicclick;
-            #endregion
-
-
 
             #endregion
 
         }
-       
+
         /// <summary>
         /// 瀹夐槻鏉′欢View
         /// </summary>
@@ -377,276 +94,85 @@
         {
             UserView.HomePage.Instance.ScrollEnabled = false;
             Dictionary<string, string> SecurityConditionsInfo = new Dictionary<string, string>();
-            //var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-            //this.AddChidren(flMain);
-            flMain.MouseUpEventHandler += (sender12, e12) =>
+            #region  ---鐣岄潰甯冨眬閮ㄥ垎---
+            CompleteView completeView = new CompleteView();
+            flMain.AddChidren(completeView.Show(4));
+            completeView.Btntitle.TextID = MyInternationalizationString.security;
+            EventHandler<MouseEventArgs> clickcancel = (sender, e) =>
             {
-                flMain.RemoveFromParent();
-            };
-
-          
-            var securityfra = new FrameLayout
-            {
-                Width = Application.GetRealWidth(1080),
-                Height = Application.GetRealHeight(690+160),
-                Y = Application.GetRealHeight(1920 - 690-160),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                //Radius = (uint)Application.GetRealHeight(60),
-            };
-            flMain.AddChidren(securityfra);
-            securityfra.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
-            #region  -------鍙栨秷   瀹屾垚
-            var timetype = new RowLayout
-            {
-                Height = Application.GetRealHeight(140),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            securityfra.AddChidren(timetype);
-            var Btncancel = new Button
-            {
-                TextID = MyInternationalizationString.cancel,
-                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                X = Application.GetRealWidth(80),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextSize = 14,
-            };
-            timetype.AddChidren(Btncancel);
-            Btncancel.MouseUpEventHandler += (sender16, e16) =>
-            {
-                flMain.RemoveFromParent();
                 UserView.HomePage.Instance.ScrollEnabled = true;
+                flMain.RemoveFromParent();
             };
-
-            var Btntitle = new Button
-            {
-                TextID = MyInternationalizationString.security,
-                TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(320),
-                TextAlignment = TextAlignment.Center,
-                X = Btncancel.Right + Application.GetRealWidth(100),
-                TextSize = 16,
-            };
-            timetype.AddChidren(Btntitle);
-            var Btncomplete = new Button
-            {
-                TextID = MyInternationalizationString.complete,
-                TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                TextAlignment = TextAlignment.CenterRight,
-                X = Btntitle.Right + Application.GetRealWidth(100),
-                TextSize = 14,
-
-            };
-            timetype.AddChidren(Btncomplete);
+            flMain.MouseUpEventHandler += clickcancel;
+            completeView.Btncancel.MouseUpEventHandler += clickcancel;
+            //鍦ㄥ甯冮槻
+            mFunView athomeView = new mFunView();
+            athomeView.frameLayout.Y = Application.GetRealHeight(140 + 20);
+            completeView.Show(4).AddChidren(athomeView.Show());
+            athomeView.titleBtn.TextID = MyInternationalizationString.logicathomegarrison;
+            //绂诲甯冮槻
+            mFunView removeView = new mFunView();
+            removeView.frameLayout.Y = athomeView.frameLayout.Bottom;
+            completeView.Show(4).AddChidren(removeView.Show());
+            removeView.titleBtn.TextID = MyInternationalizationString.logicremovehomegarrison;
+            //鎾ら槻
+            mFunView withdrawalView = new mFunView();
+            withdrawalView.frameLayout.Y = removeView.frameLayout.Bottom;
+            completeView.Show(4).AddChidren(withdrawalView.Show());
+            withdrawalView.titleBtn.TextID = MyInternationalizationString.withdrawal;
+            //鑳佽揩鎾ら槻
+            mFunView urgentwithdrawalView = new mFunView();
+            urgentwithdrawalView.frameLayout.Y = withdrawalView.frameLayout.Bottom;
+            completeView.Show(4).AddChidren(urgentwithdrawalView.Show());
+            urgentwithdrawalView.titleBtn.TextID = MyInternationalizationString.urgentwithdrawal;
+            urgentwithdrawalView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
             #endregion
-
-
-            #region  ----鍦ㄥ甯冮槻 绂诲甯冮槻  鎾ら槻 鑳佽揩鎾ら槻
-
-            #region  鍦ㄥ甯冮槻
-
-
-            var athomeFrameLayout = new FrameLayout
+            athomeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                Height = Application.GetRealHeight(160),
-                Y = timetype.Bottom + Application.GetRealHeight(20),
+                athomeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                removeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                withdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                urgentwithdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                athomeView.selectedIconBtn.Visible = true;
+                removeView.selectedIconBtn.Visible = false;
+                withdrawalView.selectedIconBtn.Visible = false;
+                urgentwithdrawalView.selectedIconBtn.Visible = false;
             };
-            securityfra.AddChidren(athomeFrameLayout);
-
-            var athomedefenceRowLayout = new RowLayout
+            removeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            athomeFrameLayout.AddChidren(athomedefenceRowLayout);
+                athomeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                removeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                withdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                urgentwithdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                athomeView.selectedIconBtn.Visible = false;
+                removeView.selectedIconBtn.Visible = true;
+                withdrawalView.selectedIconBtn.Visible = false;
+                urgentwithdrawalView.selectedIconBtn.Visible = false;
 
-            var btnathomedefence = new Button
+            };
+            withdrawalView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.logicathomegarrison,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                TextSize = 14,
+                athomeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                removeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                withdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                urgentwithdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                athomeView.selectedIconBtn.Visible = false;
+                removeView.selectedIconBtn.Visible = false;
+                withdrawalView.selectedIconBtn.Visible = true;
+                urgentwithdrawalView.selectedIconBtn.Visible = false;
             };
-            athomedefenceRowLayout.AddChidren(btnathomedefence);
-
-
-            var athomedefenceSelected = new SelectedButton();
-            athomedefenceRowLayout.AddChidren(athomedefenceSelected);
-
-            #endregion
-            #region  绂诲甯冮槻
-
-            var leavehomeFrameLayout = new FrameLayout
+            urgentwithdrawalView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                Height = Application.GetRealHeight(160),
-                Y = athomeFrameLayout.Bottom,
-            };
-            securityfra.AddChidren(leavehomeFrameLayout);
+                athomeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                removeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                withdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                urgentwithdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                athomeView.selectedIconBtn.Visible = false;
+                removeView.selectedIconBtn.Visible = false;
+                withdrawalView.selectedIconBtn.Visible = false;
+                urgentwithdrawalView.selectedIconBtn.Visible = true;
 
-            var leavehomedefenceRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
             };
-            leavehomeFrameLayout.AddChidren(leavehomedefenceRowLayout);
-
-            var leavehomebtndefence = new Button
-            {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.logicremovehomegarrison,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                TextSize = 14,
-            };
-            leavehomedefenceRowLayout.AddChidren(leavehomebtndefence);
-            var leavehomedefenceSelected = new SelectedButton();
-            leavehomedefenceRowLayout.AddChidren(leavehomedefenceSelected);
-            #endregion
-            #region  鎾ら槻
-            var withdrawalFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = leavehomeFrameLayout.Bottom,
-            };
-            securityfra.AddChidren(withdrawalFrameLayout);
-
-
-            var withdrawalRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            withdrawalFrameLayout.AddChidren(withdrawalRowLayout);
-
-            var btnwithdrawal = new Button
-            {
-
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.withdrawal,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                TextSize = 14,
-            };
-            withdrawalRowLayout.AddChidren(btnwithdrawal);
-            var withdrawalSelected = new SelectedButton();
-            withdrawalRowLayout.AddChidren(withdrawalSelected);
-            #endregion
-            #region  鑳佽揩鎾ら槻
-            var urgentwithdFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = withdrawalFrameLayout.Bottom,
-            };
-            securityfra.AddChidren(urgentwithdFrameLayout);
-
-
-            var urgentwithdrawalRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            urgentwithdFrameLayout.AddChidren(urgentwithdrawalRowLayout);
-
-            var btnurgentwithdrawal = new Button
-            {
-                TextID = MyInternationalizationString.urgentwithdrawal,
-                Width = Application.GetRealWidth(600),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                TextSize = 14,
-            };
-            urgentwithdrawalRowLayout.AddChidren(btnurgentwithdrawal);
-
-            var urgentwithdrawalSelected = new SelectedButton();
-            urgentwithdrawalRowLayout.AddChidren(urgentwithdrawalSelected);
-            #endregion
-            #region  ----鍦ㄥ甯冮槻 绂诲甯冮槻  鎾ら槻 鑳佽揩鎾ら槻鐐瑰嚮浜嬩欢
-            ///鍦ㄥ甯冮槻鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> athomeclick = (sedner14, e14) =>
-            {
-                btnathomedefence.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                leavehomebtndefence.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnurgentwithdrawal.TextColor= ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                athomedefenceSelected.Visible = true;
-                leavehomedefenceSelected.Visible = false;
-                withdrawalSelected.Visible = false;
-                urgentwithdrawalSelected.Visible = false;
-            };
-            athomedefenceRowLayout.MouseUpEventHandler += athomeclick;
-            btnathomedefence.MouseUpEventHandler += athomeclick;
-            athomedefenceSelected.MouseUpEventHandler += athomeclick;
-            athomeFrameLayout.MouseUpEventHandler += athomeclick;
-
-            ///绂诲甯冮槻鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> leavehomeclick = (sedner14, e14) =>
-            {
-                btnathomedefence.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                leavehomebtndefence.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                btnwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnurgentwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                athomedefenceSelected.Visible = false;
-                leavehomedefenceSelected.Visible = true;
-                withdrawalSelected.Visible = false;
-                urgentwithdrawalSelected.Visible = false;
-            };
-            leavehomedefenceRowLayout.MouseUpEventHandler += leavehomeclick;
-            leavehomebtndefence.MouseUpEventHandler += leavehomeclick;
-            leavehomedefenceSelected.MouseUpEventHandler += leavehomeclick;
-            leavehomeFrameLayout.MouseUpEventHandler += leavehomeclick;
-            ///鎾ら槻鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> disableclick = (sedner15, e15) =>
-            {
-                btnathomedefence.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                leavehomebtndefence.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                btnurgentwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                athomedefenceSelected.Visible = false;
-                leavehomedefenceSelected.Visible = false;
-                withdrawalSelected.Visible = true;
-                urgentwithdrawalSelected.Visible = false;
-            };
-            withdrawalRowLayout.MouseUpEventHandler += disableclick;
-            btnwithdrawal.MouseUpEventHandler += disableclick;
-            withdrawalSelected.MouseUpEventHandler += disableclick;
-            withdrawalFrameLayout.MouseUpEventHandler += disableclick;
-
-            ///鑳佽揩鎾ら槻鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> urgentwithdrawalclick = (seder, e) =>
-            {
-                btnathomedefence.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                leavehomebtndefence.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnurgentwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                athomedefenceSelected.Visible = false;
-                leavehomedefenceSelected.Visible = false;
-                withdrawalSelected.Visible = false;
-                urgentwithdrawalSelected.Visible = true;
-            };
-            urgentwithdrawalRowLayout.MouseUpEventHandler += urgentwithdrawalclick;
-            btnurgentwithdrawal.MouseUpEventHandler += urgentwithdrawalclick;
-            urgentwithdrawalSelected.MouseUpEventHandler += urgentwithdrawalclick;
-            urgentwithdFrameLayout.MouseUpEventHandler += urgentwithdrawalclick;
-            #endregion
-            #endregion
-
 
             if (edit)
             {
@@ -659,58 +185,58 @@
                         {
                             if (securityifon["ModeId"] == "1")
                             {
-                                btnathomedefence.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                                leavehomebtndefence.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                btnwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                btnurgentwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                athomedefenceSelected.Visible = true;
-                                leavehomedefenceSelected.Visible = false;
-                                withdrawalSelected.Visible = false;
-                                urgentwithdrawalSelected.Visible = false;
+                                athomeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                                removeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                withdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                urgentwithdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                athomeView.selectedIconBtn.Visible = true;
+                                removeView.selectedIconBtn.Visible = false;
+                                withdrawalView.selectedIconBtn.Visible = false;
+                                urgentwithdrawalView.selectedIconBtn.Visible = false;
                             }
                             else
                             {
-                                btnathomedefence.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                leavehomebtndefence.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                                btnwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                btnurgentwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                athomedefenceSelected.Visible = false;
-                                leavehomedefenceSelected.Visible = true;
-                                withdrawalSelected.Visible = false;
-                                urgentwithdrawalSelected.Visible = false;
+                                athomeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                removeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                                withdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                urgentwithdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                athomeView.selectedIconBtn.Visible = false;
+                                removeView.selectedIconBtn.Visible = true;
+                                withdrawalView.selectedIconBtn.Visible = false;
+                                urgentwithdrawalView.selectedIconBtn.Visible = false;
                             }
 
 
                         }
                         else if (securityifon["EnOrWithdrawMode"] == "1")
                         {
-                            btnathomedefence.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                            leavehomebtndefence.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                            btnwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                            btnurgentwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                            athomedefenceSelected.Visible = false;
-                            leavehomedefenceSelected.Visible = false;
-                            withdrawalSelected.Visible = true;
-                            urgentwithdrawalSelected.Visible = false;
+                            athomeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                            removeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                            withdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                            urgentwithdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                            athomeView.selectedIconBtn.Visible = false;
+                            removeView.selectedIconBtn.Visible = false;
+                            withdrawalView.selectedIconBtn.Visible = true;
+                            urgentwithdrawalView.selectedIconBtn.Visible = false;
                         }
                         else if (securityifon["EnOrWithdrawMode"] == "2")
                         {
-                            btnathomedefence.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                            leavehomebtndefence.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                            btnwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                            btnurgentwithdrawal.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                            athomedefenceSelected.Visible = false;
-                            leavehomedefenceSelected.Visible = false;
-                            withdrawalSelected.Visible = false;
-                            urgentwithdrawalSelected.Visible = true;
+                            athomeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                            removeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                            withdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                            urgentwithdrawalView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                            athomeView.selectedIconBtn.Visible = false;
+                            removeView.selectedIconBtn.Visible = false;
+                            withdrawalView.selectedIconBtn.Visible = false;
+                            urgentwithdrawalView.selectedIconBtn.Visible = true;
                         }
                         break;
                     }
                 }
             }
-            Btncomplete.MouseUpEventHandler += (sender, e) =>
+            completeView.Btncomplete.MouseUpEventHandler += (sender, e) =>
             {
-                if (!athomedefenceSelected.Visible && !leavehomedefenceSelected.Visible && !withdrawalSelected.Visible&&!urgentwithdrawalSelected.Visible)
+                if (!athomeView.selectedIconBtn.Visible && !removeView.selectedIconBtn.Visible && !withdrawalView.selectedIconBtn.Visible && !urgentwithdrawalView.selectedIconBtn.Visible)
                 {
                     return;
                 }
@@ -738,28 +264,28 @@
                     SecurityConditionsInfo.Remove("ModeId");
                 }
                 //鍦ㄥ甯冮槻
-                if (athomedefenceSelected.Visible)
+                if (athomeView.selectedIconBtn.Visible)
                 {
-                    
+
                     SecurityConditionsInfo.Add("EnOrWithdrawMode", "0");
                     SecurityConditionsInfo.Add("ModeId", "1");
                 }
                 //绂诲甯冮槻
-                if (leavehomedefenceSelected.Visible)
+                if (removeView.selectedIconBtn.Visible)
                 {
-                  
+
                     SecurityConditionsInfo.Add("EnOrWithdrawMode", "0");
                     SecurityConditionsInfo.Add("ModeId", "2");
                 }
                 //鎾ら槻
-                if (withdrawalSelected.Visible)
+                if (withdrawalView.selectedIconBtn.Visible)
                 {
-                    
+
                     SecurityConditionsInfo.Add("EnOrWithdrawMode", "1");
                     SecurityConditionsInfo.Add("ModeId", "0");
                 }
                 //鑳佽揩鎾ら槻
-                if (urgentwithdrawalSelected.Visible)
+                if (urgentwithdrawalView.selectedIconBtn.Visible)
                 {
 
                     SecurityConditionsInfo.Add("EnOrWithdrawMode", "2");
@@ -782,171 +308,48 @@
         {
             UserView.HomePage.Instance.ScrollEnabled = false;
             Dictionary<string, string> LocationConditionsInfo = new Dictionary<string, string>();
-            //var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-            //this.AddChidren(flMain);
-            flMain.MouseUpEventHandler += (sender12, e12) =>
+            #region  ------鐣岄潰甯冨眬閮ㄥ垎   
+            CompleteView completeView = new CompleteView();
+            flMain.AddChidren(completeView.Show(2));
+            completeView.Btntitle.TextID = MyInternationalizationString.location;
+            EventHandler<MouseEventArgs> clickcancel = (sender, e) =>
             {
-                flMain.RemoveFromParent();
-            };
-
-
-            var Locationfra = new FrameLayout
-            {
-                Width = Application.GetRealWidth(1080),
-                Height = Application.GetRealHeight(530),
-                Y = Application.GetRealHeight(1920 - 530),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                //Radius = (uint)Application.GetRealHeight(60),
-            };
-            flMain.AddChidren(Locationfra);
-            Locationfra.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
-
-            #region  -------鍙栨秷   瀹屾垚
-            var typeRow = new RowLayout
-            {
-                Height = Application.GetRealHeight(140),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            Locationfra.AddChidren(typeRow);
-            var Btncancel = new Button
-            {
-                TextID = MyInternationalizationString.cancel,
-                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                X = Application.GetRealWidth(80),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextSize = 14,
-            };
-            typeRow.AddChidren(Btncancel);
-            Btncancel.MouseUpEventHandler += (sender16, e16) =>
-            {
-                flMain.RemoveFromParent();
                 UserView.HomePage.Instance.ScrollEnabled = true;
+                flMain.RemoveFromParent();
             };
-
-            var Btntitle = new Button
-            {
-                TextID = MyInternationalizationString.location,
-                TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(320),
-                TextAlignment = TextAlignment.Center,
-                X = Btncancel.Right + Application.GetRealWidth(100),
-                TextSize = 16,
-            };
-            typeRow.AddChidren(Btntitle);
-            var Btncomplete = new Button
-            {
-                TextID = MyInternationalizationString.complete,
-                TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                TextAlignment = TextAlignment.CenterRight,
-                X = Btntitle.Right + Application.GetRealWidth(100),
-                TextSize = 14,
-
-            };
-            typeRow.AddChidren(Btncomplete);
-            #endregion
-
-            #region  ------鍒拌揪鍦扮偣   绂诲紑鍦扮偣  
-            #region ------鍒拌揪鍦扮偣
-
-            var athomeFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = typeRow.Bottom + Application.GetRealHeight(20),
-            };
-            Locationfra.AddChidren(athomeFrameLayout);
-
-            var athomeRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            athomeFrameLayout.AddChidren(athomeRowLayout);
-
-            var btnathome = new Button
-            {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.athome,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                TextSize = 14,
-
-
-            };
-            athomeRowLayout.AddChidren(btnathome);
-            var athomeSelected = new SelectedButton();
-            athomeRowLayout.AddChidren(athomeSelected);
-            #endregion
-
-            #region -------绂诲紑鍦扮偣 
-            var leavehomeFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = athomeFrameLayout.Bottom,
-            };
-            Locationfra.AddChidren(leavehomeFrameLayout);
-
-            var leavehomeRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            leavehomeFrameLayout.AddChidren(leavehomeRowLayout);
-
-            var btnleavehome = new Button
-            {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.leavehome,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                TextSize = 14,
-            };
-            leavehomeRowLayout.AddChidren(btnleavehome);
-            var leavehomeSelected = new SelectedButton();
-            leavehomeRowLayout.AddChidren(leavehomeSelected);
-            #endregion
-
+            flMain.MouseUpEventHandler += clickcancel;
+            completeView.Btncancel.MouseUpEventHandler += clickcancel;
+            //鍒拌揪鍦扮偣
+            mFunView athomeView = new mFunView();
+            athomeView.frameLayout.Y = Application.GetRealHeight(140 + 20);
+            completeView.Show(2).AddChidren(athomeView.Show());
+            athomeView.titleBtn.TextID = MyInternationalizationString.athome;
+            //绂诲紑鍦扮偣
+            mFunView leaveView = new mFunView();
+            leaveView.frameLayout.Y = athomeView.frameLayout.Bottom;
+            completeView.Show(2).AddChidren(leaveView.Show());
+            leaveView.titleBtn.TextID = MyInternationalizationString.leavehome;
+            leaveView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
             #endregion
             string strname = "";
-            ///鍒拌揪鍦扮偣鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> athomeclick = (sedner15, e15) =>
-            {
-                strname = btnathome.Text;
-                btnleavehome.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnathome.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                leavehomeSelected.Visible = false;
-                athomeSelected.Visible = true;
+            //鍒拌揪鍦扮偣鐐瑰嚮浜嬩欢
+            athomeView.clickviewBtn.MouseUpEventHandler += (sender, e) => {
 
-
+                strname = athomeView.titleBtn.Text;
+                leaveView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                athomeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                leaveView.selectedIconBtn.Visible = false;
+                athomeView.selectedIconBtn.Visible = true;
             };
-            btnathome.MouseUpEventHandler += athomeclick;
-            athomeSelected.MouseUpEventHandler += athomeclick;
-            athomeRowLayout.MouseUpEventHandler += athomeclick;
-            athomeFrameLayout.MouseUpEventHandler += athomeclick;
-
-            ///绂诲紑鍦扮偣鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> leavehomeclick = (sedner14, e14) =>
-            {
-                strname = btnleavehome.Text;
-                btnleavehome.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                btnathome.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                leavehomeSelected.Visible = true;
-                athomeSelected.Visible = false;
+            //绂诲紑鍦扮偣鐐瑰嚮浜嬩欢
+            leaveView.clickviewBtn.MouseUpEventHandler += (sender, e) => {
+                strname = leaveView.titleBtn.Text;
+                leaveView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                athomeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                leaveView.selectedIconBtn.Visible = true;
+                athomeView.selectedIconBtn.Visible = false;
             };
-            btnleavehome.MouseUpEventHandler += leavehomeclick;
-            leavehomeSelected.MouseUpEventHandler += leavehomeclick;
-            leavehomeRowLayout.MouseUpEventHandler += leavehomeclick;
-            leavehomeFrameLayout.MouseUpEventHandler += leavehomeclick;
+           
             double latitude = Config.Instance.Home.Latitude;//绾害
             double longitude = Config.Instance.Home.Longitude;//缁忓害
             int r = 500;//鍗婂緞
@@ -959,21 +362,21 @@
                     if (Locationifon["Type"] == "7")
                     {
                         guid = Locationifon["WhoSiteUId"];
-                        if (Locationifon["AtHome"] == "0")
+                        if (Locationifon["AtHome"] == "1")
                         {
-                            strname = btnleavehome.Text;
-                            leavehomeSelected.Visible = true;
-                            athomeSelected.Visible = false;
-                            btnleavehome.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                            btnathome.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                            strname = athomeView.titleBtn.Text;
+                            leaveView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                            athomeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                            leaveView.selectedIconBtn.Visible = false;
+                            athomeView.selectedIconBtn.Visible = true;
                         }
                         else
                         {
-                            strname = btnathome.Text;
-                            leavehomeSelected.Visible = false;
-                            athomeSelected.Visible = true;
-                            btnleavehome.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                            btnathome.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                            strname = leaveView.titleBtn.Text;
+                            leaveView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                            athomeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                            leaveView.selectedIconBtn.Visible = true;
+                            athomeView.selectedIconBtn.Visible = false;
                         }
                         break;
                     }
@@ -986,7 +389,7 @@
                     {
 
                         ///杞崲涓篸ouble绫诲瀷锛�
-                        latitude = Convert.ToDouble(accounts["Latitude"])/1000000.0;
+                        latitude = Convert.ToDouble(accounts["Latitude"]) / 1000000.0;
                         longitude = Convert.ToDouble(accounts["Longitude"]) / 1000000.0;
                         r = int.Parse(accounts["Radius"]);
                         break;
@@ -994,10 +397,10 @@
                 }
             }
 
-            Btncomplete.MouseUpEventHandler += (sender, e) =>
+            completeView.Btncomplete.MouseUpEventHandler += (sender, e) =>
             {
 
-                if (!leavehomeSelected.Visible && !athomeSelected.Visible)
+                if (!leaveView.selectedIconBtn.Visible && !athomeView.selectedIconBtn.Visible)
                 {
                     ///鍙互鎻愮ず鏈�変腑鐘舵�侊紱
                     return;
@@ -1018,7 +421,7 @@
                 LocationConditionsInfo.Add("Type", "7");
                 LocationConditionsInfo.Add("IsValid", "1");
                 LocationConditionsInfo.Add("WhoSiteUId", Config.Instance.Guid);
-                if (leavehomeSelected.Visible)
+                if (leaveView.selectedIconBtn.Visible)
                 {
                     if (LocationConditionsInfo.ContainsKey("AtHome"))
                     {
@@ -1087,186 +490,58 @@
         {
             UserView.HomePage.Instance.ScrollEnabled = false;
             Dictionary<string, string> SecurityConditionsInfo = new Dictionary<string, string>();
+            #region  ------鐣岄潰甯冨眬閮ㄥ垎   
             var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor };
             this.AddChidren(flMain);
-            flMain.MouseUpEventHandler += (sender12, e12) =>
+            CompleteView completeView = new CompleteView();
+            flMain.AddChidren(completeView.Show(2));
+            completeView.Btntitle.TextID = MyInternationalizationString.type;
+            EventHandler<MouseEventArgs> clickcancel = (sender, e) =>
             {
-                flMain.RemoveFromParent();
-            };
-
-           
-
-            var timetypeframelayout = new FrameLayout
-            {
-                Width = Application.GetRealWidth(1080),
-                Height = Application.GetRealHeight(530),
-                Y = Application.GetRealHeight(1920 - 530),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-               // Radius = (uint)Application.GetRealHeight(60),
-            };
-            flMain.AddChidren(timetypeframelayout);
-            timetypeframelayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerTopRight);
-
-            #region  -------鍙栨秷   瀹屾垚
-            var timetype = new RowLayout
-            {
-                Height = Application.GetRealHeight(140),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            timetypeframelayout.AddChidren(timetype);
-            var Btncancel = new Button
-            {
-                TextID = MyInternationalizationString.cancel,
-                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                X = Application.GetRealWidth(80),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextSize = 14,
-            };
-            timetype.AddChidren(Btncancel);
-            Btncancel.MouseUpEventHandler += (sender16, e16) =>
-            {
-                flMain.RemoveFromParent();
                 UserView.HomePage.Instance.ScrollEnabled = true;
+                flMain.RemoveFromParent();
             };
+            flMain.MouseUpEventHandler += clickcancel;
+            completeView.Btncancel.MouseUpEventHandler += clickcancel;
 
-            var Btntitle = new Button
-            {
-                TextID = MyInternationalizationString.type,
-                TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(320),
-                TextAlignment = TextAlignment.Center,
-                X = Btncancel.Right + Application.GetRealWidth(100),
-                TextSize = 16,
-            };
-            timetype.AddChidren(Btntitle);
-            var Btncomplete = new Button
-            {
-                TextID = MyInternationalizationString.complete,
-                TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                TextAlignment = TextAlignment.CenterRight,
-                X = Btntitle.Right + Application.GetRealWidth(100),
-                TextSize = 14,
-
-            };
-            timetype.AddChidren(Btncomplete);
+            //绔嬪嵆鎵ц
+            mFunView timepointView = new mFunView();
+            timepointView.frameLayout.Y = Application.GetRealHeight(140 + 20);
+            completeView.Show(2).AddChidren(timepointView.Show());
+            timepointView.titleBtn.TextID = MyInternationalizationString.immediateexecution;
+            //鏃堕棿鑼冨洿
+            mFunView timeView = new mFunView();
+            timeView.frameLayout.Y = timepointView.frameLayout.Bottom;
+            completeView.Show(2).AddChidren(timeView.Show());
+            timeView.titleBtn.TextID = MyInternationalizationString.timeframe;
+            timeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
             #endregion
+            //绔嬪嵆鎵ц鐐瑰嚮浜嬩欢
+            timepointView.clickviewBtn.MouseUpEventHandler += (sender, e) => {
 
-            #region  -------绔嬪嵆鎵ц   鏃堕棿鑼冨洿
-
-            #region  -------绔嬪嵆鎵ц 
-            var timepointFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = timetype.Bottom + Application.GetRealHeight(20),
+                timeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                timepointView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                timeView.selectedIconBtn.Visible = false;
+                timepointView.selectedIconBtn.Visible = true;
             };
-            timetypeframelayout.AddChidren(timepointFrameLayout);
-
-            var timerow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+            //鏃堕棿鑼冨洿鐐瑰嚮浜嬩欢
+            timeView.clickviewBtn.MouseUpEventHandler += (sender, e) => {
+                timeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                timepointView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                timeView.selectedIconBtn.Visible = true;
+                timepointView.selectedIconBtn.Visible = false;
             };
-            timepointFrameLayout.AddChidren(timerow);
 
-
-            var Btntimepoint = new Button
+            completeView.Btncomplete.MouseUpEventHandler += (sender, e) =>
             {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.immediateexecution,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                //Text="绔嬪嵆鎵ц",
-                TextSize = 14,
-            };
-            timerow.AddChidren(Btntimepoint);
-
-            var timepointSelected = new SelectedButton();
-            timerow.AddChidren(timepointSelected);
-            #endregion
-
-
-            #region  -------鏃堕棿鑼冨洿
-            var timeFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = timepointFrameLayout.Bottom,
-            };
-            timetypeframelayout.AddChidren(timeFrameLayout);
-
-            var time1row = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-            };
-            timeFrameLayout.AddChidren(time1row);
-
-            var Btntime = new Button
-            {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.timeframe,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                //Text = "鏃堕棿鑼冨洿",
-                TextSize = 14,
-            };
-            time1row.AddChidren(Btntime);
-
-            var timeSelected = new SelectedButton();
-            time1row.AddChidren(timeSelected);
-            #endregion
-
-
-            ///绔嬪嵆鎵ц鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> timepointclick = (sedner14, e14) =>
-            {
-                Btntimepoint.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                Btntime.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                timepointSelected.Visible = true;
-                timeSelected.Visible = false;
-            };
-            timepointFrameLayout.MouseUpEventHandler += timepointclick;
-            timerow.MouseUpEventHandler += timepointclick;
-            Btntimepoint.MouseUpEventHandler += timepointclick;
-            timepointSelected.MouseUpEventHandler += timepointclick;
-
-
-            ///鏃堕棿鑼冨洿鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> timeclick = (sedner15, e15) =>
-            {
-                Btntimepoint.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                Btntime.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                timepointSelected.Visible = false;
-                timeSelected.Visible = true;
-            };
-            Btntime.MouseUpEventHandler += timeclick;
-            time1row.MouseUpEventHandler += timeclick;
-            timeSelected.MouseUpEventHandler += timeclick;
-            timeFrameLayout.MouseUpEventHandler += timeclick;
-            #endregion
-
-
-
-            Btncomplete.MouseUpEventHandler += (sender, e) =>
-            {
-                if (!timepointSelected.Visible && !timeSelected.Visible)
+                if (!timepointView.selectedIconBtn.Visible && !timeView.selectedIconBtn.Visible)
                 {
                     ///鍙互鎻愮ず鏈�変腑鐘舵�侊紱
                     return;
                 }
                 UserView.HomePage.Instance.ScrollEnabled = true;
                 flMain.RemoveFromParent();
-                if (timepointSelected.Visible)
+                if (timepointView.selectedIconBtn.Visible)
                 {
 
                     Dictionary<string, string> timeConditionsInfo = new Dictionary<string, string>();
@@ -1295,5 +570,5 @@
         }
 
     }
- 
+
 }
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
index 2f34fb8..b6fe64a 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/AddScenePage.cs
@@ -16,124 +16,69 @@
         {
             Tag = "Logic";
         }
+     
+        ///鎴块棿婊戝姩鎺т欢
+        public HorizontalScrolViewLayout roomhorizontalScrol = new HorizontalScrolViewLayout
+        {
+            Width = Application.GetRealWidth(1080 - 58),
+            Height = Application.GetRealHeight(200),
+            Y = Application.GetRealHeight(184),
+            X = Application.GetRealWidth(58),
+        };
+        public VerticalScrolViewLayout middle = new VerticalScrolViewLayout
+        {
+            Width = Application.GetRealWidth(1080),
+            Height = Application.GetRealHeight(1920 - 260 - 200 - 184),
+            BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
+        };
+        public FrameLayout saveframeLayout = new FrameLayout {
+            Height = Application.GetRealHeight(260),
+            BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
+        };
+
         Button roombjButton = new Button();
         Button roomTextButton = new Button();
         Button clickbutton = new Button();
-        HorizontalScrolViewLayout roomhorizontalScrol;
-        VerticalScrolViewLayout middle;
         public string clickTag = "no";
         public SceneUI tempScene = null;
         Dictionary<string, object> actionsInfo = new Dictionary<string, object>();
-        public void Show()
+        public void Show(string sceneType)
         {
+            #region  涓婇潰鐨勫竷灞�浠g爜
             UserView.HomePage.Instance.ScrollEnabled = false;
             this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView(true));
+            view.toptitleNameBtn.TextID =MyInternationalizationString.addscene;
+            view.clickBtn.MouseDownEventHandler += (sender, e) =>
             {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(160),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.addscene,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
                 UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) => {
                 RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
             };
-
-            var foolrname = new Button
+            view.foolrnameBtn.Text = Config.Instance.Home.GetCurrentFloorName;
+            if (Config.Instance.Home.FloorDics.Count < 2)
             {
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterRight,
-                X = Application.GetRealWidth(1080 - 400 - 120),
-                Width = Application.GetRealWidth(400),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                //TextID = MyInternationalizationString.customroom,
-                Text = Config.Instance.Home.GetCurrentFloorName,
-                TextSize = 14,
-            };
-            topRowLayout.AddChidren(foolrname);
-            var dropdown = new Button
+                ///娌℃湁妤煎眰鎴栬�呭彧鏈変竴涓ゼ灞傦紝榛樿涓嶆樉绀哄浘鏍囧拰鏂囨湰;
+                view.foolrnameBtn.Visible = false;
+                view.dropdownBtn.Visible = false;
+                view.foolrclickBtn.Visible = false;
+            }
+            if (Config.Instance.Home.FloorDics.Count == 0)
             {
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterRight,
-                X = foolrname.Right,
-                Width = Application.GetRealWidth(72),
-                Height = Application.GetRealHeight(72),
-                Y = Application.GetRealHeight(92),
-                UnSelectedImagePath = "ZigeeLogic/drop-down.png",
-            };
-            topRowLayout.AddChidren(dropdown);
+                Config.Instance.Home.CurrentFloorId = "";
+            }
             #endregion
-        
+
             ///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱
             if (Common.Room.Lists.Count == 0)
             {
                 return;
             }
-            ///鎴块棿婊戝姩鎺т欢
-             roomhorizontalScrol = new HorizontalScrolViewLayout()
-            {
-                Width = Application.GetRealWidth(1080 - 58),
-                Height = Application.GetRealHeight(200),
-                Y = topRowLayout.Bottom,
-                X = Application.GetRealWidth(58),
-            };
+         
             this.AddChidren(roomhorizontalScrol);
-
-
-
-            middle = new VerticalScrolViewLayout();
             middle.Y = roomhorizontalScrol.Bottom;
-            middle.Height = Application.GetRealHeight(1920 - 260 - 200 - 184);
-            middle.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
             this.AddChidren(middle);
-
-            var saveframeLayout = new FrameLayout
-            {
-                Y = middle.Bottom,
-                Height = Application.GetRealHeight(260),
-                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-            };
+            saveframeLayout.Y = middle.Bottom;
             this.AddChidren(saveframeLayout);
 
             var btnsave = new Button
@@ -165,17 +110,26 @@
                 }
                 actionsInfo.Add("LinkType", 2);
                 LogicIfon.AddSceneactions(tempScene, actionsInfo);
-                var logicCommunalPage = new LogicCommunalPage();
-                UserView.HomePage.Instance.AddChidren(logicCommunalPage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                logicCommunalPage.Show(() => { });
+                if (sceneType ==LogicView.IfString.Action_LogicScene)
+                {
+                    //鑷姩鍖栧満鏅�
+                    var logicCommunalPage = new LogicCommunalPage();
+                    UserView.HomePage.Instance.AddChidren(logicCommunalPage);
+                    UserView.HomePage.Instance.PageIndex += 1;
+                    logicCommunalPage.Show(() => { });
+                }
+                else {
+                    //闂ㄩ攣鍦烘櫙
+                    var lockLogicCommunalPage = new DoorLockLogic.LockLogicCommunalPage();
+                    UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
+                    UserView.HomePage.Instance.PageIndex += 1;
+                    lockLogicCommunalPage.Show(() => { });
+                }
 
             };
 
-         
-
             ///妤煎眰鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> foorlclick = (sender, e) =>
+            view.foolrclickBtn.MouseUpEventHandler += (sender, e) =>
             {
 
                 var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
@@ -248,7 +202,7 @@
                         TextSize = 14,
                     };
                     foolrRowLayout.AddChidren(btnfoolrname);
-                    if (foolrname.Text == foolr.Value)
+                    if (view.foolrnameBtn.Text == foolr.Value)
                     {
                         btnfoolricon.UnSelectedImagePath = "Floor/FloorSelected.png";
                         btnfoolrname.TextColor = ZigbeeColor.Current.LogicTextBlackColor;
@@ -257,10 +211,10 @@
                     EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) =>
                     {
                         roomhorizontalScrol.RemoveAll();
-                        foolrname.Text = btnfoolrname.Text;
+                        view.foolrnameBtn.Text = btnfoolrname.Text;
                         middle.RemoveAll();
                         flMain.RemoveFromParent();
-                        var list = Send.GetRoomList(btnfoolrname.Tag.ToString());
+                        var list = Method.GetRoomList(sceneType, btnfoolrname.Tag.ToString());
                         AllRoomView(list);
 
                     };
@@ -271,32 +225,13 @@
                 }
 
             };
-            foolrname.MouseUpEventHandler += foorlclick;
-            dropdown.MouseUpEventHandler += foorlclick;
-
-            ///绗竴娆¤繘鏉�
-            var roomlists = new List<Common.Room>();
-            roomlists.Clear();
-            if (Config.Instance.Home.FloorDics.Count < 2)
+            ///鎴块棿鍒楄〃
+            var roomlists = Method.GetRoomList(sceneType, Config.Instance.Home.CurrentFloorId);
+            if (roomlists.Count == 0)
             {
-                foolrname.Visible = false;
-                dropdown.Visible = false;
-                if (Config.Instance.Home.FloorDics.Count == 0)
-                {
-                    roomlists.AddRange(Common.Room.Lists);
-                }
-                else
-                {
-                    roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
-                }
+                ///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱
+                return;
             }
-            else
-            {
-                roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
-
-            }
-
-
             ///绗竴娆¤繘鏉�
             AllRoomView(roomlists);
 
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs b/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs
new file mode 100644
index 0000000..317bb6c
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/CurrentDeviceState.cs
@@ -0,0 +1,1315 @@
+锘縰sing System;
+using Shared.Common;
+using Shared.R;
+using Shared;
+using ZigBee.Device;
+using System.Collections.Generic;
+namespace Shared.Phone.Device.Logic
+{
+    public class CurrentDeviceState
+    {
+        /// <summary>
+        /// 閫変腑璇ヨ澶囧姛鑳戒綔涓烘潯浠舵垨鑰呯洰鏍囩殑瑙嗗浘鏂规硶
+        /// </summary>
+        /// <param name="common">Common.</param>
+        public static void CurrentDeviceView(FrameLayout flMain, CommonDevice common, bool edit, string str)
+        {
+            #region  -------鐣岄潰甯冨眬閮ㄥ垎
+            //涓嶈褰撳墠鐣岄潰婊戝姩
+            UserView.HomePage.Instance.ScrollEnabled = false;
+            CompleteView completeView = new CompleteView();
+            flMain.AddChidren(completeView.Show(1));
+            completeView.Btntitle.Text = common.DeviceEpointName;
+            EventHandler<MouseEventArgs> clickcancel = (sender, e) =>
+            {
+                UserView.HomePage.Instance.ScrollEnabled = true;
+                flMain.RemoveFromParent();
+            };
+            flMain.MouseUpEventHandler += clickcancel;
+            completeView.Btncancel.MouseUpEventHandler += clickcancel;
+
+            mFunView openView = new mFunView();
+            openView.frameLayout.Y = Application.GetRealHeight(140 + 20);
+            //completeView.Show(l).AddChidren(openView.Show());
+            openView.titleBtn.TextID = MyInternationalizationString.open;
+
+            mFunView closeView = new mFunView();
+            closeView.frameLayout.Y = openView.frameLayout.Bottom;
+            //completeView.Show(l).AddChidren(closeView.Show());
+            closeView.titleBtn.TextID = MyInternationalizationString.close;
+
+            mFunView takebackView = new mFunView();
+            takebackView.frameLayout.Y = closeView.frameLayout.Bottom;
+            //completeView.Show(l).AddChidren(takebackView.Show());
+            takebackView.titleBtn.TextID = MyInternationalizationString.onoff;
+            takebackView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+
+            var horizontalSeekBarRowLien = new RowLayout
+            {
+                Y = openView.frameLayout.Bottom,
+                Width = Application.GetRealWidth(920),
+                Height = Application.GetRealHeight(160),
+                X = Application.GetRealWidth(80),
+                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+            };
+            var horizontalSeekBarVol = new DiyImageSeekBar
+            {
+                Y = openView.frameLayout.Bottom,
+                X = Application.GetRealWidth(80),
+                Width = Application.GetRealWidth(920),
+                Height = Application.GetRealHeight(160),
+                IsProgressTextShow = true,//鏄剧ず鐧惧垎姣�
+                IsClickable = false,//杩涘害鏉℃槸鍚︽粦鍔�
+                ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//閫変腑杩涘害鏉¢鑹�
+                ThumbImagePath = "ZigeeLogic/progressbtn2.png",//杩涘害鏉℃寜閽浘鏍�
+                ThumbImageHeight = Application.GetRealHeight(56),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
+                ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+                ProgressTextSize = 12,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏� 
+                SeekBarViewHeight = Application.GetRealHeight(10),//杩涘害鏉$殑楂樺害
+            };
+            #endregion
+
+            #region  -------鏁版嵁澶勭悊閮ㄥ垎
+            #region  -------鏉′欢
+            Dictionary<string, string> deviceConditionsInfo = new Dictionary<string, string>();
+            Send.dictionary(deviceConditionsInfo, "Type", "1");
+            Send.dictionary(deviceConditionsInfo, "IsValid", "1");
+            Send.dictionary(deviceConditionsInfo, "MacAddr", common.DeviceAddr);
+            Send.dictionary(deviceConditionsInfo, "Epoint", common.DeviceEpoint.ToString());
+            Dictionary<string, string> devices = null;
+            #endregion
+            #region  -------鐩爣
+            Dictionary<string, object> actionsInfo = new Dictionary<string, object>();
+            List<Dictionary<string, string>> taskListInfo = new List<Dictionary<string, string>>();
+            actionsInfo.Add("LinkType", 0);
+            actionsInfo.Add("DeviceAddr", common.DeviceAddr);
+            actionsInfo.Add("Epoint", common.DeviceEpoint);
+            actionsInfo.Add("Time", 0);
+            actionsInfo.Add("TaskList", taskListInfo);
+            List<Dictionary<string, string>> TaskList = null;
+            #endregion
+            var _if=str.Split('_');
+            if (edit)
+            {
+                if (_if[0]== "condition")
+                {
+                    foreach (var deviceinfo in Common.Logic.CurrentLogic.Conditions)
+                    {
+                        if (deviceinfo["Type"] == "1")
+                        {
+                            if (common.DeviceAddr == deviceinfo["MacAddr"] && common.DeviceEpoint.ToString() == deviceinfo["Epoint"])
+                            {
+                                devices = deviceinfo;
+                                break;
+
+                            }
+                        }
+                    }
+                }
+                else
+                {
+                    foreach (var deviceinfo in Common.Logic.CurrentLogic.Actions)
+                    {
+                        if (deviceinfo["LinkType"].ToString() == "0")
+                        {
+
+                            if (deviceinfo["DeviceAddr"].ToString() == common.DeviceAddr && deviceinfo["Epoint"].ToString() == common.DeviceEpoint.ToString())
+                            {
+                                TaskList = deviceinfo["TaskList"] as List<Dictionary<string, string>>;
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+            #endregion
+            int l = 0;
+            string SelectedDeviceStatus = "";
+            switch (common.Type)
+            {
+                ///鐏厜
+                case DeviceType.OnOffOutput:
+                    {
+                        if (_if[0] == "condition")
+                        {
+                            l = 2;
+                            Send.dictionary(deviceConditionsInfo, "Cluster_ID", "6");
+                            Send.dictionary(deviceConditionsInfo, "AttriButeId", "0");
+                            Send.dictionary(deviceConditionsInfo, "Range", "1");
+                            Send.dictionary(deviceConditionsInfo, "AttriButeData2", "0");
+
+                            #region  鐏厜View
+                            completeView.Show(l).AddChidren(openView.Show());
+                            completeView.Show(l).AddChidren(closeView.Show());
+                            closeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+                            #endregion
+
+                            ///鐐瑰嚮纭浜嬩欢
+                            openView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                            {
+                                openView.selectedIconBtn.Visible = true;
+                                closeView.selectedIconBtn.Visible = false;
+                                openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                                closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                SelectedDeviceStatus = "OnOffOutput";
+                                Send.dictionary(deviceConditionsInfo, "AttriButeData1", "1");//榛樿鍊�
+
+
+                            };
+
+                            ///鐐瑰嚮鍙栨秷浜嬩欢
+                            closeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                            {
+                                openView.selectedIconBtn.Visible = false;
+                                closeView.selectedIconBtn.Visible = true;
+                                openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                                SelectedDeviceStatus = "OnOffOutput";
+                                Send.dictionary(deviceConditionsInfo, "AttriButeData1", "0");//榛樿鍊�
+
+                            };
+
+                            if (edit && devices != null)
+                            {
+                                if (devices["AttriButeId"] == "0")
+                                {
+                                    if (devices["AttriButeData1"] == "1")
+                                    {
+                                        openView.selectedIconBtn.Visible = true;
+                                        closeView.selectedIconBtn.Visible = false;
+                                        openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                                        closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                    }
+                                    else
+                                    {
+                                        openView.selectedIconBtn.Visible = false;
+                                        closeView.selectedIconBtn.Visible = true;
+                                        openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                        closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+
+                                    }
+                                }
+                            }
+                        }
+                        else
+                        {
+                            l = 3;
+                            #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
+                            Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
+                            Send.dictionary(switchdictionary, "TaskType", "1");
+                            Send.dictionary(switchdictionary, "Data1", "0");
+                            Send.dictionary(switchdictionary, "Data2", "0");
+                            taskListInfo.Add(switchdictionary);
+
+                            #endregion
+
+                            #region  鐏厜View
+
+                            completeView.Show(l).AddChidren(openView.Show());
+                            completeView.Show(l).AddChidren(closeView.Show());
+                            completeView.Show(l).AddChidren(takebackView.Show());
+                            takebackView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+                            #endregion
+
+                            ///纭浜嬩欢
+                            openView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                            {
+                                SelectedDeviceStatus = "yes";
+                                openView.selectedIconBtn.Visible = true;
+                                closeView.selectedIconBtn.Visible = false;
+                                takebackView.selectedIconBtn.Visible = false;
+                                Send.dictionary(switchdictionary, "Data1", "1");//榛樿鍊�
+                            };
+                            ///鍙栨秷浜嬩欢
+                            closeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                            {
+                                SelectedDeviceStatus = "yes";
+                                openView.selectedIconBtn.Visible = false;
+                                closeView.selectedIconBtn.Visible = true;
+                                takebackView.selectedIconBtn.Visible = false;
+                                Send.dictionary(switchdictionary, "Data1", "0");//榛樿鍊�
+
+                            };
+                            //鍙栧弽
+                            takebackView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                            {
+                                SelectedDeviceStatus = "yes";
+                                openView.selectedIconBtn.Visible = false;
+                                closeView.selectedIconBtn.Visible = false;
+                                takebackView.selectedIconBtn.Visible = true;
+                                Send.dictionary(switchdictionary, "Data1", "2");//榛樿鍊�
+
+                            };
+
+                            if (edit && TaskList != null)
+                            {
+                                foreach (var value in TaskList)
+                                {
+                                    if (value["TaskType"] == "1")
+                                    {
+                                        var data1 = value["Data1"];
+                                        Send.dictionary(switchdictionary, "Data1", data1);
+                                        openView.selectedIconBtn.Visible = false;
+                                        closeView.selectedIconBtn.Visible = false;
+                                        takebackView.selectedIconBtn.Visible = false;
+                                        switch (data1)
+                                        {
+                                            case "1":
+                                                {
+                                                    openView.selectedIconBtn.Visible = true;
+                                                }
+                                                break;
+                                            case "0":
+                                                {
+                                                    closeView.selectedIconBtn.Visible = true;
+                                                }
+                                                break;
+                                            case "2":
+                                                {
+                                                    takebackView.selectedIconBtn.Visible = true;
+                                                }
+                                                break;
+                                        }
+
+                                    }
+
+                                }
+                            }
+                        }
+                    }
+                    break;
+                case DeviceType.IASZone:
+                    {
+                        var iASZonedevice = common as IASZone;
+                        if (iASZonedevice.DeviceID != 1026)
+                        {
+                            break;
+                        }
+
+                        Send.dictionary(deviceConditionsInfo, "Cluster_ID", "1280");
+                        Send.dictionary(deviceConditionsInfo, "AttriButeId", "1281");
+                        Send.dictionary(deviceConditionsInfo, "AttriButeData2", "0");
+
+                        int timevalue = 0;
+                        ///鐐瑰嚮纭浜嬩欢
+                        openView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                        {
+                            SelectedDeviceStatus = "IASZone";
+                            openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                            closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                            openView.selectedIconBtn.Visible = true;
+                            closeView.selectedIconBtn.Visible = false;
+                            if (iASZonedevice.IasDeviceType == 13)
+                            {
+                                closeView.selectedIconBtn.Visible = true;
+                            }
+                            Send.dictionary(deviceConditionsInfo, "Range", "5");
+                            Send.dictionary(deviceConditionsInfo, "AttriButeData1", "1");
+                        };
+                        ///鐐瑰嚮鍙栨秷浜嬩欢
+                        closeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                        {
+                            SelectedDeviceStatus = "IASZone";
+                            openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                            closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                            openView.selectedIconBtn.Visible = false;
+                            closeView.selectedIconBtn.Visible = true;
+                            Send.dictionary(deviceConditionsInfo, "Range", "1");
+                            Send.dictionary(deviceConditionsInfo, "AttriButeData1", "0");
+                            if (iASZonedevice.IasDeviceType == 13)
+                            {
+                                SelectedDeviceStatus = "";
+                                openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                openView.selectedIconBtn.Visible = false;
+                                closeView.selectedIconBtn.Visible = true;
+                                var ignoreTime = new IgnoreTime();
+                                UserView.HomePage.Instance.AddChidren(ignoreTime);
+                                UserView.HomePage.Instance.PageIndex += 1;
+                                ignoreTime.Show(common, closeView.titleBtn.Text, edit, timevalue);
+                            }
+
+
+                        };
+
+                        switch (iASZonedevice.IasDeviceType)
+                        {
+                            case 13:
+                                {
+                                    openView.titleBtn.TextID = MyInternationalizationString.someone;
+                                    closeView.titleBtn.TextID = MyInternationalizationString.unattendedtime1;
+                                    closeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+                                    closeView.selectedIconBtn.UnSelectedImagePath = "ZigeeLogic/next.png";
+                                    closeView.selectedIconBtn.Visible = true;
+                                    completeView.Show(2).AddChidren(openView.Show());
+                                    completeView.Show(2).AddChidren(closeView.Show());
+                                }
+                                break;
+                            case 21:
+                            case 22:
+                                {
+                                    #region
+                                    openView.titleBtn.TextID = MyInternationalizationString.logicopen;
+                                    closeView.titleBtn.TextID = MyInternationalizationString.logicclose;
+                                    completeView.Show(3).AddChidren(openView.Show());
+                                    completeView.Show(3).AddChidren(closeView.Show());
+
+                                    mFunView timeoutView = new mFunView();
+                                    timeoutView.frameLayout.Y = closeView.frameLayout.Bottom;
+                                    timeoutView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+                                    completeView.Show(3).AddChidren(timeoutView.Show());
+                                    timeoutView.titleBtn.TextID = MyInternationalizationString.closetimeout;
+                                    timeoutView.selectedIconBtn.UnSelectedImagePath = "ZigeeLogic/next.png";
+                                    timeoutView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                                    {
+                                        SelectedDeviceStatus = "";
+                                        openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                        closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                        openView.selectedIconBtn.Visible = false;
+                                        closeView.selectedIconBtn.Visible = false;
+                                        var ignoreTime = new IgnoreTime();
+                                        UserView.HomePage.Instance.AddChidren(ignoreTime);
+                                        UserView.HomePage.Instance.PageIndex += 1;
+                                        ignoreTime.Show(common, timeoutView.titleBtn.Text, edit, timevalue);
+
+                                    };
+
+                                    #endregion
+                                }
+                                break;
+                            case 40:
+                                {
+                                    openView.titleBtn.TextID = MyInternationalizationString.smokescreen;
+                                    openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+                                    completeView.Show(1).AddChidren(openView.Show());
+                                }
+                                break;
+                            case 42:
+                                {
+                                    openView.titleBtn.TextID = MyInternationalizationString.waterleakage;
+                                    closeView.titleBtn.TextID = MyInternationalizationString.noleakage;
+                                    closeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+                                    completeView.Show(2).AddChidren(openView.Show());
+                                    completeView.Show(2).AddChidren(closeView.Show());
+
+                                }
+                                break;
+                            case 43:
+                                {
+                                    openView.titleBtn.TextID = MyInternationalizationString.gas;
+                                    openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+                                    completeView.Show(1).AddChidren(openView.Show());
+                                }
+                                break;
+                            case 44:
+                                {
+                                    openView.titleBtn.TextID = MyInternationalizationString.emergencybutton;
+                                    openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+                                    completeView.Show(1).AddChidren(openView.Show());
+                                }
+                                break;
+                            case 277:
+                                {
+                                    openView.titleBtn.TextID = MyInternationalizationString.callthepolice;
+                                    openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+                                    completeView.Show(1).AddChidren(openView.Show());
+                                }
+                                break;
+                            default:
+                                {
+                                    openView.titleBtn.TextID = MyInternationalizationString.callthepolice;
+                                    openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+                                    completeView.Show(1).AddChidren(openView.Show());
+
+                                }
+                                break;
+                        }
+                        if (edit && devices != null)
+                        {
+                            if (devices["AttriButeId"] == "1281")
+                            {
+                                if (devices["AttriButeData1"] == "1")
+                                {
+                                    openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                                    closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                    openView.selectedIconBtn.Visible = true;
+                                    closeView.selectedIconBtn.Visible = false;
+                                }
+                                else
+                                {
+                                    if (devices.ContainsKey("IgnoreTime"))
+                                    {
+                                        timevalue = int.Parse(devices["IgnoreTime"]);
+                                    }
+                                    else
+                                    {
+                                        openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                                        closeView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                                        openView.selectedIconBtn.Visible = false;
+                                        closeView.titleBtn.Visible = true;
+                                    }
+                                }
+                            }
+
+
+                        }
+
+                    }
+                    break;
+                case DeviceType.OnOffSwitch:
+                    {
+                        l = 1;
+                        Send.dictionary(deviceConditionsInfo, "Cluster_ID", "1282");
+                        Send.dictionary(deviceConditionsInfo, "AttriButeId", "1283");
+                        Send.dictionary(deviceConditionsInfo, "Range", "0");//鎸夐敭鐗规畩
+                        Send.dictionary(deviceConditionsInfo, "AttriButeData1", "0");
+                        Send.dictionary(deviceConditionsInfo, "AttriButeData2", "0");
+
+                        completeView.Show(l).AddChidren(openView.Show());
+                        openView.titleBtn.Text = Language.StringByID(MyInternationalizationString.OnOffSwitch) + common.DeviceEpoint.ToString();
+                        openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+                        openView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                        {
+                            SelectedDeviceStatus = "OnOffSwitch";
+                            openView.selectedIconBtn.Visible = true;
+                            openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                        };
+
+                        if (edit && devices != null)
+                        {
+                            openView.selectedIconBtn.Visible = true;
+                            openView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                        }
+
+                    }
+                    break;
+                case DeviceType.DoorLock:
+                    {
+
+                        flMain.RemoveFromParent();
+                        var memberList = new MemberList();
+                        UserView.HomePage.Instance.AddChidren(memberList);
+                        UserView.HomePage.Instance.PageIndex += 1;
+                        MemberList.edit = false;
+                        memberList.Show(common);
+                    }
+                    break;
+                case DeviceType.TemperatureSensor:
+                    {
+                        l = 4;
+                        string current = Language.StringByID(MyInternationalizationString.current);
+                        completeView.Show(l);
+                        var temperatureSensor = common as TemperatureSensor;
+                        SelectedDeviceStatus = "TemperatureSensor";
+                        #region  甯冨眬View
+                        var PickerViewfra = new FrameLayout
+                        {
+                            Y = Application.GetRealHeight(140),
+                            Height = Application.GetRealHeight(640),
+                        };
+                        completeView.Show(l).AddChidren(PickerViewfra);
+                        var mUIPickerView = new UIPickerView
+                        {
+                            Height = Application.GetRealHeight(640 - 5),
+                        };
+                        PickerViewfra.AddChidren(mUIPickerView);
+
+                        var mList1 = new List<string> { ">", "<", "=", "鈮�", "鈮�" };
+                        var mList2 = new List<string>();
+                        var mList3 = new List<string>();
+                        for (int i = 1; i <= 100; i++)
+                        {
+                            mList2.Add(i.ToString());
+                        }
+                        if (temperatureSensor.SensorDiv == 1)
+                        {
+                            mList3.Add("鈩�");
+                            Send.dictionary(deviceConditionsInfo, "Cluster_ID", "1026");
+                            Send.dictionary(deviceConditionsInfo, "AttriButeId", "0");
+                            Send.dictionary(deviceConditionsInfo, "Range", "1");//1:绛変簬AttriButeData1鏃惰Е鍙戝姩浣�
+                            Send.dictionary(deviceConditionsInfo, "AttriButeData1", "50");//榛樿娓╁害鍊�50鈩�
+                            Send.dictionary(deviceConditionsInfo, "AttriButeData2", "0");
+                        }
+                        else
+                        {
+                            mList3.Add("%");
+                            Send.dictionary(deviceConditionsInfo, "Cluster_ID", "1029");
+                            Send.dictionary(deviceConditionsInfo, "AttriButeId", "0");
+                            Send.dictionary(deviceConditionsInfo, "Range", "1");//1:绛変簬AttriButeData1鏃惰Е鍙戝姩浣�
+                            Send.dictionary(deviceConditionsInfo, "AttriButeData1", "50");//榛樿婀垮害鍊�50%
+                            Send.dictionary(deviceConditionsInfo, "AttriButeData2", "0");
+                        }
+                        mUIPickerView.setNPicker(mList1, mList2, mList3);
+
+                        #endregion
+
+                        mUIPickerView.OnSelectChangeEvent += (s1, s2, s3) =>
+                        {
+                            SelectedDeviceStatus = "TemperatureSensor";
+                            Send.dictionary(deviceConditionsInfo, "AttriButeData1", mList2[s2]);
+                            switch (mList1[s1])
+                            {
+                                case ">":
+                                    {
+                                        Send.dictionary(deviceConditionsInfo, "Range", "0");
+                                    }
+                                    break;
+                                case "<":
+                                    {
+                                        Send.dictionary(deviceConditionsInfo, "Range", "2");
+                                    }
+                                    break;
+                                case "=":
+                                    {
+                                        Send.dictionary(deviceConditionsInfo, "Range", "1");
+                                    }
+                                    break;
+                                case "鈮�":
+                                    {
+                                        Send.dictionary(deviceConditionsInfo, "Range", "6");
+                                    }
+                                    break;
+                                case "鈮�":
+                                    {
+                                        Send.dictionary(deviceConditionsInfo, "Range", "7");
+                                    }
+                                    break;
+                            }
+                        };
+
+                        //榛樿=,50
+                        int index1 = 2, index2 = 49;
+                        if (edit && devices != null)
+                        {
+                            SelectedDeviceStatus = "";
+                            string s = "";
+                            switch (devices["Range"])
+                            {
+                                case "0":
+                                    {
+                                        s = ">";
+                                    }
+                                    break;
+                                case "1":
+                                    {
+                                        s = "=";
+                                    }
+                                    break;
+                                case "2":
+                                    {
+                                        s = "<";
+                                    }
+                                    break;
+                                case "6":
+                                    {
+                                        s = "鈮�";
+                                    }
+                                    break;
+                                case "7":
+                                    {
+                                        s = "鈮�";
+                                    }
+                                    break;
+                            }
+                            //鏌ユ壘绱㈠紩
+                            index1 = mList1.IndexOf(s);
+                            index2 = mList2.IndexOf(devices["AttriButeData1"]);
+
+                        }
+                        ///鏇存柊鏈�鏂扮姸鎬侊紱
+                        mUIPickerView.setCurrentItems(index1, index2, 0);
+
+                    }
+                    break;
+                ///璋冨厜鐏厜
+                case DeviceType.DimmableLight:
+                    {
+                        l = 4;
+                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
+                        Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
+                        Send.dictionary(switchdictionary, "Data2", "0");
+                        taskListInfo.Add(switchdictionary);
+                        completeView.Show(l).AddChidren(openView.Show());
+                        openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+                        completeView.Show(l).AddChidren(horizontalSeekBarRowLien);
+                        completeView.Show(l).AddChidren(horizontalSeekBarVol);
+                        closeView.frameLayout.Y = horizontalSeekBarRowLien.Bottom;
+                        completeView.Show(l).AddChidren(closeView.Show());
+
+                        takebackView.frameLayout.Y = closeView.frameLayout.Bottom;
+                        completeView.Show(l).AddChidren(takebackView.Show());
+                        takebackView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+                        #endregion
+                        int Progressvalue = 100;
+                        EventHandler<int> progressclick = (sender, e) =>
+                        {
+                            SelectedDeviceStatus = "yes";
+                            Progressvalue = horizontalSeekBarVol.Progress;
+                            Send.dictionary(switchdictionary, "TaskType", "3");
+                            //鏈�澶т寒搴﹀�兼槸254闇�瑕佽浆鎹紱
+                            var lightbrightnessvalue = (254 * horizontalSeekBarVol.Progress) / 100;
+                            Send.dictionary(switchdictionary, "Data1", lightbrightnessvalue.ToString());
+
+                        };
+                        horizontalSeekBarVol.OnProgressChangedEvent += progressclick;
+                        horizontalSeekBarVol.OnStopTrackingTouchEvent += progressclick;
+                        ///纭浜嬩欢
+                        openView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                        {
+                            SelectedDeviceStatus = "yes";
+                            horizontalSeekBarVol.IsClickable = true;
+                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected;
+                            openView.selectedIconBtn.Visible = true;
+                            closeView.selectedIconBtn.Visible = false;
+                            takebackView.selectedIconBtn.Visible = false;
+                            horizontalSeekBarVol.Progress = Progressvalue;
+                            Send.dictionary(switchdictionary, "TaskType", "3");
+                            //鏈�澶т寒搴﹀�兼槸254闇�瑕佽浆鎹紱
+                            var lightbrightnessvalue = (254 * horizontalSeekBarVol.Progress) / 100;
+                            Send.dictionary(switchdictionary, "Data1", lightbrightnessvalue.ToString());
+                        };
+
+                        ///鍙栨秷浜嬩欢
+                        closeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                        {
+                            SelectedDeviceStatus = "yes";
+                            horizontalSeekBarVol.IsClickable = false;
+                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
+                            openView.selectedIconBtn.Visible = false;
+                            closeView.selectedIconBtn.Visible = true;
+                            takebackView.selectedIconBtn.Visible = false;
+                            Send.dictionary(switchdictionary, "TaskType", "1");
+                            Send.dictionary(switchdictionary, "Data1", "0");//榛樿鍊�
+                        };
+
+                        //鍙栧弽
+                        takebackView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                        {
+                            SelectedDeviceStatus = "yes";
+                            horizontalSeekBarVol.IsClickable = false;
+                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
+                            openView.selectedIconBtn.Visible = false;
+                            closeView.selectedIconBtn.Visible = false;
+                            takebackView.selectedIconBtn.Visible = true;
+                            Send.dictionary(switchdictionary, "TaskType", "1");
+                            Send.dictionary(switchdictionary, "Data1", "2");//榛樿鍊�
+
+                        };
+                        if (edit && TaskList != null)
+                        {
+                            foreach (var value in TaskList)
+                            {
+                                var tasktype = value["TaskType"];
+                                var data1 = value["Data1"];
+                                Send.dictionary(switchdictionary, "TaskType", tasktype);
+                                Send.dictionary(switchdictionary, "Data1", data1);
+                                openView.selectedIconBtn.Visible = false;
+                                closeView.selectedIconBtn.Visible = false;
+                                takebackView.selectedIconBtn.Visible = false;
+                                horizontalSeekBarVol.IsClickable = false;
+                                horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
+                                if (tasktype == "1")
+                                {
+                                    if (data1 == "0")
+                                    {
+                                        closeView.selectedIconBtn.Visible = true;
+                                    }
+                                    else if (data1 == "2")
+                                    {
+                                        takebackView.selectedIconBtn.Visible = true;
+                                    }
+                                }
+                                else if (tasktype == "3")
+                                {
+                                    openView.selectedIconBtn.Visible = true;
+                                    horizontalSeekBarVol.IsClickable = true;
+                                    horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected;
+                                    horizontalSeekBarVol.Progress = int.Parse(data1) * 100 / 254;
+                                    Progressvalue = horizontalSeekBarVol.Progress;
+
+                                }
+                                break;
+
+                            }
+                        }
+
+                    }
+                    break;
+                ///绐楀笜
+                case DeviceType.WindowCoveringDevice:
+                    {
+                        l = 3;
+                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
+                        Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
+                        Send.dictionary(switchdictionary, "TaskType", "6");
+                        taskListInfo.Add(switchdictionary);
+
+                        completeView.Show(l).AddChidren(openView.Show());
+                        openView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+
+
+                        completeView.Show(l).AddChidren(horizontalSeekBarRowLien);
+                        completeView.Show(l).AddChidren(horizontalSeekBarVol);
+
+                        closeView.frameLayout.Y = horizontalSeekBarRowLien.Bottom;
+                        completeView.Show(l).AddChidren(closeView.Show());
+                        closeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+                        #endregion
+                        int Progressvalue = 100;
+                        EventHandler<int> progressclick = (sender, e) =>
+                        {
+                            SelectedDeviceStatus = "yes";
+                            Progressvalue = horizontalSeekBarVol.Progress;
+                            Send.dictionary(switchdictionary, "Data1", "5");
+                            Send.dictionary(switchdictionary, "Data2", horizontalSeekBarVol.Progress.ToString());
+                        };
+                        horizontalSeekBarVol.OnProgressChangedEvent += progressclick;
+                        horizontalSeekBarVol.OnStopTrackingTouchEvent += progressclick;
+                        ///纭浜嬩欢
+                        openView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                        {
+                            SelectedDeviceStatus = "yes";
+                            horizontalSeekBarVol.IsClickable = true;
+                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected;
+                            openView.selectedIconBtn.Visible = true;
+                            closeView.selectedIconBtn.Visible = false;
+                            horizontalSeekBarVol.Progress = Progressvalue;
+                            Send.dictionary(switchdictionary, "Data1", "5");
+                            Send.dictionary(switchdictionary, "Data2", horizontalSeekBarVol.Progress.ToString());
+
+                        };
+                        ///鍙栨秷浜嬩欢
+                        closeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                        {
+                            SelectedDeviceStatus = "yes";
+                            horizontalSeekBarVol.IsClickable = false;
+                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
+                            openView.selectedIconBtn.Visible = false;
+                            closeView.selectedIconBtn.Visible = true;
+                            Send.dictionary(switchdictionary, "Data2", "0");
+                            Send.dictionary(switchdictionary, "Data1", "1");//榛樿鍊�
+
+                        };
+
+                        if (edit && TaskList != null)
+                        {
+                            foreach (var value in TaskList)
+                            {
+                                if (value["TaskType"] == "6")
+                                {
+                                    if (value["Data1"] == "5")
+                                    {
+
+                                        Send.dictionary(switchdictionary, "Data1", "5");
+                                        Send.dictionary(switchdictionary, "Data2", value["Data2"]);
+                                        horizontalSeekBarVol.IsClickable = true;
+                                        horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected;
+                                        openView.selectedIconBtn.Visible = true;
+                                        closeView.selectedIconBtn.Visible = false;
+                                        horizontalSeekBarVol.Progress = int.Parse(value["Data2"]);
+                                        Progressvalue = horizontalSeekBarVol.Progress;
+                                    }
+                                    else if (value["Data1"] == "1")
+                                    {
+                                        Send.dictionary(switchdictionary, "Data1", "1");
+                                        openView.selectedIconBtn.Visible = false;
+                                        closeView.selectedIconBtn.Visible = true;
+                                        horizontalSeekBarVol.IsClickable = false;
+                                        horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
+                                    }
+
+                                }
+
+                            }
+                        }
+                    }
+                    break;
+                ///绌烘皵寮�鍏�
+                case DeviceType.AirSwitch:
+                    {
+                        {
+                            l = 3;
+                            #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
+                            Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
+                            Send.dictionary(switchdictionary, "TaskType", "1");
+                            Send.dictionary(switchdictionary, "Data1", "0");
+                            Send.dictionary(switchdictionary, "Data2", "0");
+                            taskListInfo.Add(switchdictionary);
+                            #endregion
+
+                            #region  绌烘皵鐏厜View
+
+                            completeView.Show(l).AddChidren(openView.Show());
+                            completeView.Show(l).AddChidren(closeView.Show());
+                            completeView.Show(l).AddChidren(takebackView.Show());
+                            takebackView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+
+                            #endregion
+
+                            ///纭浜嬩欢
+                            openView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                            {
+                                SelectedDeviceStatus = "yes";
+                                openView.selectedIconBtn.Visible = true;
+                                closeView.selectedIconBtn.Visible = false;
+                                takebackView.selectedIconBtn.Visible = false;
+                                Send.dictionary(switchdictionary, "Data1", "1");
+
+                            };
+                            ///鍙栨秷浜嬩欢
+                            closeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                            {
+                                SelectedDeviceStatus = "yes";
+                                openView.selectedIconBtn.Visible = false;
+                                closeView.selectedIconBtn.Visible = true;
+                                takebackView.selectedIconBtn.Visible = false;
+                                Send.dictionary(switchdictionary, "Data1", "0");
+
+                            };
+                            //鍙栧弽
+                            takebackView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                            {
+                                SelectedDeviceStatus = "yes";
+                                openView.selectedIconBtn.Visible = false;
+                                closeView.selectedIconBtn.Visible = false;
+                                takebackView.selectedIconBtn.Visible = true;
+                                Send.dictionary(switchdictionary, "Data1", "2");
+
+                            };
+
+                            if (edit && TaskList != null)
+                            {
+                                foreach (var value in TaskList)
+                                {
+                                    if (value["TaskType"] == "1")
+                                    {
+                                        var data1 = value["Data1"];
+                                        Send.dictionary(switchdictionary, "Data1", data1);
+                                        openView.selectedIconBtn.Visible = false;
+                                        closeView.selectedIconBtn.Visible = false;
+                                        takebackView.selectedIconBtn.Visible = false;
+                                        if (data1 == "1")
+                                        {
+                                            openView.selectedIconBtn.Visible = true;
+                                        }
+                                        else if (data1 == "0")
+                                        {
+                                            closeView.selectedIconBtn.Visible = true;
+                                        }
+                                        else if (data1 == "2")
+                                        {
+                                            takebackView.selectedIconBtn.Visible = true;
+                                        }
+                                        break;
+                                    }
+
+                                }
+                            }
+
+                        }
+                    }
+                    break;
+                ///绌鸿皟
+                case DeviceType.Thermostat:
+                    {
+                        l = 6;
+                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
+                        var temperaturedictionary = new Dictionary<string, string>();
+                        var modedictionary = new Dictionary<string, string>();
+                        var speeddictionary = new Dictionary<string, string>();
+                        Send.dictionary(temperaturedictionary, "TaskType", "5");
+                        Send.dictionary(modedictionary, "TaskType", "5");
+                        Send.dictionary(modedictionary, "Data1", "3");
+                        Send.dictionary(speeddictionary, "TaskType", "5");
+                        Send.dictionary(speeddictionary, "Data1", "6");
+                        taskListInfo.Add(temperaturedictionary);
+                        taskListInfo.Add(modedictionary);
+                        taskListInfo.Add(speeddictionary);
+                        #endregion
+                        #region  绌鸿皟View
+
+                        completeView.Show(l).AddChidren(openView.Show());
+
+                        #region  绌鸿皟鐘舵�乂iew
+                        var PickerViewfra = new FrameLayout
+                        {
+                            Y = openView.frameLayout.Bottom,
+                            Height = Application.GetRealHeight(640),
+                        };
+                        completeView.Show(l).AddChidren(PickerViewfra);
+
+                        //閬尅绌鸿皟婊戝姩view锛�
+                        var pausePickerViewfra = new FrameLayout
+                        {
+                            Y = openView.frameLayout.Bottom,
+                            Height = Application.GetRealHeight(640),
+                            BackgroundColor = 0x60ffffff,
+                        };
+                        completeView.Show(l).AddChidren(pausePickerViewfra);
+
+                        var mUIPickerView = new UIPickerView
+                        {
+                            Height = Application.GetRealHeight(640 - 5),
+                        };
+                        PickerViewfra.AddChidren(mUIPickerView);
+                        var line = new Button
+                        {
+                            Y = Application.GetRealHeight(640 - 5),
+                            Width = Application.GetRealWidth(920),
+                            Height = Application.GetRealHeight(5),
+                            X = Application.GetRealWidth(80),
+                            BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+                        };
+                        PickerViewfra.AddChidren(line);
+
+                        var mList1 = new List<string>();
+                        var mList2 = new List<string> {
+                         Language.StringByID(MyInternationalizationString.logiccool),
+                         Language.StringByID(MyInternationalizationString.logicheat),
+                         Language.StringByID(MyInternationalizationString.logicauto),
+                         Language.StringByID(MyInternationalizationString.logicdry),
+                         Language.StringByID(MyInternationalizationString.logicfanonly),
+                        };
+                        var mList3 = new List<string>{
+                         Language.StringByID(MyInternationalizationString.logiclow),
+                         Language.StringByID(MyInternationalizationString.logicmedium),
+                         Language.StringByID(MyInternationalizationString.logichigh),
+                          };
+                        for (int i = 16; i < 33; i++)
+                        {
+                            mList1.Add(i.ToString() + " " + "鈩�");
+                        }
+                        mUIPickerView.setNPicker(mList1, mList2, mList3);
+                        ///榛樿鐘舵��
+
+
+                        #endregion
+
+                        closeView.frameLayout.Y = PickerViewfra.Bottom;
+                        completeView.Show(l).AddChidren(closeView.Show());
+                        closeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
+
+                        //榛樿26,鑷姩,涓
+                        int indextemperature = 10, indexmode = 2, indexspeed = 1;
+                        mUIPickerView.OnSelectChangeEvent += (s1, s2, s3) =>
+                        {
+                            indextemperature = s1;
+                            indexmode = s2;
+                            indexspeed = s3;
+                            if (openView.selectedIconBtn.Visible)
+                            {
+                                SelectedDeviceStatus = "yes";
+                                var temperature = mList1[s1].Split(' ')[0];
+                                var modestring = mList2[s2].Split(' ')[0];
+                                var speedstring = mList3[s3].Split(' ')[0];
+                                ModeState(modestring, temperaturedictionary, modedictionary);
+                                var a = int.Parse(temperature) * 100;
+                                Send.dictionary(temperaturedictionary, "Data2", a.ToString());
+
+                                SpeedState(speedstring, speeddictionary);
+                            }
+                        };
+                        mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0);
+                        mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1);
+                        mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2);
+                        #endregion
+
+                        if (edit && TaskList != null)
+                        {
+
+                            foreach (var value in TaskList)
+                            {
+                                if (TaskList.Count == 1)
+                                {
+                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0);
+                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1);
+                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2);
+                                    //鏁扮粍鍙湁涓�涓厓绱犺鏄庡綋鍓嶇┖璋冪姸鎬佷负鍏筹紱
+                                    openView.selectedIconBtn.Visible = false;
+                                    closeView.selectedIconBtn.Visible = true;
+                                    pausePickerViewfra.Height = Application.GetRealHeight(600);
+                                    //濡傛灉绌鸿皟鐘舵�佹槸鍏筹紱鐩存帴璺冲嚭for寰潖锛�
+                                    break;
+
+                                }
+                                else
+                                {
+                                    openView.selectedIconBtn.Visible = true;
+                                    closeView.selectedIconBtn.Visible = false;
+                                    pausePickerViewfra.Height = Application.GetRealHeight(0);
+                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 0);
+                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 1);
+                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 2);
+                                }
+
+
+                                if (value["TaskType"] == "5")
+                                {
+                                    if (value["Data1"] == "3")
+                                    {//3---璁剧疆宸ヤ綔妯″紡(1:鑷姩;3:鍒跺喎;4:鍒剁儹;7:閫侀;8:闄ゆ箍)
+                                        Send.dictionary(modedictionary, "Data2", value["Data2"]);
+                                        string modetext = "";
+                                        switch (value["Data2"])
+                                        {
+                                            case "3":
+                                                {
+                                                    modetext = Language.StringByID(MyInternationalizationString.logiccool);
+                                                    //indexmode = 0;
+                                                }
+                                                break;
+                                            case "4":
+                                                {
+                                                    modetext = Language.StringByID(MyInternationalizationString.logicheat);
+                                                    //  indexmode = 1;
+                                                }
+                                                break;
+                                            case "1":
+                                                {
+                                                    modetext = Language.StringByID(MyInternationalizationString.logicauto);
+                                                    //   indexmode = 2;
+                                                }
+                                                break;
+                                            case "8":
+                                                {
+                                                    modetext = Language.StringByID(MyInternationalizationString.logicdry);
+                                                    //  indexmode = 3;
+                                                }
+                                                break;
+                                            case "7":
+                                                {
+                                                    modetext = Language.StringByID(MyInternationalizationString.logicfanonly);
+                                                    //indexmode = 4;
+                                                }
+                                                break;
+                                        }
+                                        indexmode = mList2.IndexOf(modetext);
+                                    }
+                                    else if (value["Data1"] == "6")
+                                    {//6---璁剧疆椋庢墖妯″紡(1:浣庨;2:涓;3:楂橀;)
+                                        Send.dictionary(speeddictionary, "Data2", value["Data2"]);
+                                        string speedtext = "";
+                                        switch (value["Data2"])
+                                        {
+                                            case "1":
+                                                {
+                                                    speedtext = Language.StringByID(MyInternationalizationString.logiclow);
+                                                    //indexspeed = 0;
+                                                }
+                                                break;
+
+                                            case "2":
+                                                {
+                                                    speedtext = Language.StringByID(MyInternationalizationString.logicmedium);
+                                                    // indexspeed = 1;
+                                                }
+                                                break;
+                                            case "3":
+                                                {
+                                                    speedtext = Language.StringByID(MyInternationalizationString.logichigh);
+                                                    // indexspeed = 2;
+                                                }
+                                                break;
+
+                                        }
+                                        indexspeed = mList3.IndexOf(speedtext);
+                                    }
+                                    //4-璁剧疆鍔犵儹搴︽暟;5-璁剧疆鍒跺喎銆侀櫎婀垮害鏁�;7-璁剧疆鑷姩搴︽暟
+                                    else if (value["Data1"] == "4" || value["Data1"] == "5" || value["Data1"] == "7")
+                                    {
+                                        var s = int.Parse(value["Data2"]) / 100;
+                                        indextemperature = mList1.IndexOf(s.ToString() + " " + "鈩�");
+                                        Send.dictionary(temperaturedictionary, "Data1", value["Data1"]);
+                                        Send.dictionary(temperaturedictionary, "Data2", value["Data2"]);
+                                    }
+
+                                }
+                            }
+                        }
+                        ///鏇存柊鏈�鏂扮┖璋冪姸鎬侊紱
+                        mUIPickerView.setCurrentItems(indextemperature, indexmode, indexspeed);
+                        ///纭浜嬩欢
+                        openView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                        {
+                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 0);
+                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 1);
+                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 2);
+                            mUIPickerView.setCurrentItems(indextemperature, indexmode, indexspeed);
+                            pausePickerViewfra.Height = Application.GetRealHeight(0);
+                            SelectedDeviceStatus = "yes";
+                            openView.selectedIconBtn.Visible = true;
+                            closeView.selectedIconBtn.Visible = false;
+                            //娓呴櫎涔嬪墠鏁版嵁锛�
+                            taskListInfo.Clear();
+                            //鍔犺浇鏂版暟鎹紱
+                            Send.dictionary(temperaturedictionary, "TaskType", "5");
+                            Send.dictionary(modedictionary, "TaskType", "5");
+                            Send.dictionary(modedictionary, "Data1", "3");
+                            Send.dictionary(speeddictionary, "TaskType", "5");
+                            Send.dictionary(speeddictionary, "Data1", "6");
+                            taskListInfo.Add(temperaturedictionary);
+                            taskListInfo.Add(modedictionary);
+                            taskListInfo.Add(speeddictionary);
+
+                            var temperature = mList1[indextemperature].Split(' ')[0];
+                            var modestring = mList2[indexmode].Split(' ')[0];
+                            var speedstring = mList3[indexspeed].Split(' ')[0];
+
+                            ModeState(modestring, temperaturedictionary, modedictionary);
+                            var a = int.Parse(temperature) * 100;
+                            Send.dictionary(temperaturedictionary, "Data2", a.ToString());
+                            SpeedState(speedstring, speeddictionary);
+
+                        };
+                        ///鍙栨秷浜嬩欢
+                        closeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                        {
+                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0);
+                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1);
+                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2);
+                            mUIPickerView.setCurrentItems(indextemperature, indexmode, indexspeed);
+                            //娓呴櫎涔嬪墠鏁版嵁锛�
+                            taskListInfo.Clear();
+                            Send.dictionary(modedictionary, "TaskType", "5");
+                            Send.dictionary(modedictionary, "Data1", "3");
+                            Send.dictionary(modedictionary, "Data2", "0");
+                            //鍔犺浇鏂版暟鎹紱
+                            taskListInfo.Add(modedictionary);
+                            pausePickerViewfra.Height = Application.GetRealHeight(600);
+                            SelectedDeviceStatus = "yes";
+                            openView.selectedIconBtn.Visible = false;
+                            closeView.selectedIconBtn.Visible = true;
+
+                        };
+                    }
+                    break;
+            }
+            completeView.Btncomplete.MouseUpEventHandler += (sender, e) =>
+            {
+                //UserView.HomePage.Instance.ScrollEnabled = true;
+                if (SelectedDeviceStatus != "")
+                {
+                    if (_if[0] == "condition")
+                    {   //娣诲姞鏉′欢
+                        LogicIfon.AddDeviceconditions(common, deviceConditionsInfo);
+                    }
+                    else
+                    {   //娣诲姞鐩爣
+                        LogicIfon.AddDeviceactions(common, actionsInfo);
+                    }
+                }
+                else
+                {
+                    if (!edit)
+                    {
+                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
+                                    Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
+                                   Language.StringByID(MyInternationalizationString.confrim));
+                        alert.Show();
+                        return;
+                    }
+
+                }
+                flMain.RemoveFromParent();
+                switch (_if[1])
+                {
+                    case "logic":
+                        {
+                            //鑷姩鍖�
+                            var logicCommunalPage = new LogicCommunalPage();
+                            UserView.HomePage.Instance.AddChidren(logicCommunalPage);
+                            UserView.HomePage.Instance.PageIndex += 1;
+                            logicCommunalPage.Show(() => { });
+                        }
+                        break;
+                    case "mould":
+                        {
+                            //鑷姩鍖栨帹鑽愭ā鏉�
+                            var templatePage = new TemplatePage();
+                            UserView.HomePage.Instance.AddChidren(templatePage);
+                            UserView.HomePage.Instance.PageIndex += 1;
+                            templatePage.Show();
+                        }
+                        break;
+                    case "lockaction":
+                        {
+                            //闂ㄩ攣鑱斿姩浜嬩欢
+                            var lockLogicCommunalPage = new DoorLockLogic.LockLogicCommunalPage();
+                            UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
+                            UserView.HomePage.Instance.PageIndex += 1;
+                            lockLogicCommunalPage.Show(() => { });
+                        }
+                        break;
+                }
+                
+
+            };
+        }
+
+        /// <summary>
+        /// 绌鸿皟妯″紡鐨勭姸鎬�
+        /// </summary>
+        /// <param name="modestring"></param>
+        /// <param name="temperaturedictionary"></param>
+        /// <param name="modedictionary"></param>
+        public static void ModeState(string modestring, Dictionary<string, string> temperaturedictionary, Dictionary<string, string> modedictionary)
+        {
+
+            if (modestring == Language.StringByID(MyInternationalizationString.logiccool))
+            {
+                Send.dictionary(modedictionary, "Data2", "3");
+                Send.dictionary(temperaturedictionary, "Data1", "5");
+            }
+            else if (modestring == Language.StringByID(MyInternationalizationString.logicheat))
+            {
+
+                Send.dictionary(modedictionary, "Data2", "4");
+                Send.dictionary(temperaturedictionary, "Data1", "4");
+            }
+            else if (modestring == Language.StringByID(MyInternationalizationString.logicauto))
+            {
+
+                Send.dictionary(modedictionary, "Data2", "1");
+                Send.dictionary(temperaturedictionary, "Data1", "7");
+            }
+            else if (modestring == Language.StringByID(MyInternationalizationString.logicdry))
+            {
+
+                Send.dictionary(modedictionary, "Data2", "8");
+                Send.dictionary(temperaturedictionary, "Data1", "5");
+            }
+            else if (modestring == Language.StringByID(MyInternationalizationString.logicfanonly))
+            {
+                Send.dictionary(temperaturedictionary, "Data1", "20");
+                Send.dictionary(modedictionary, "Data2", "7");
+            }
+
+        }
+        /// <summary>
+        /// 椋庨�熺殑妯″紡
+        /// </summary>
+        /// <param name="speedstring"></param>
+        /// <param name="speeddictionary"></param>
+        public static void SpeedState(string speedstring, Dictionary<string, string> speeddictionary)
+        {
+
+            if (speedstring == Language.StringByID(MyInternationalizationString.logiclow))
+            {
+
+                Send.dictionary(speeddictionary, "Data2", "1");
+
+            }
+            else if (speedstring == Language.StringByID(MyInternationalizationString.logicmedium))
+            {
+
+                Send.dictionary(speeddictionary, "Data2", "2");
+
+            }
+            else if (speedstring == Language.StringByID(MyInternationalizationString.logichigh))
+            {
+
+                Send.dictionary(speeddictionary, "Data2", "3");
+            }
+
+        }
+    }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/CustomText.cs b/ZigbeeApp/Shared/Phone/Device/Logic/CustomText.cs
index 84aaeb7..17b995f 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/CustomText.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/CustomText.cs
@@ -11,61 +11,17 @@
         public void Show()
         {
 
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.custompush,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
+            #region  涓婇潰鐨勫竷灞�浠g爜
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.TextID = MyInternationalizationString.custompush;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             #endregion
 
 
             var middle = new FrameLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs
index 7ee68de..4a0de72 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Cycle.cs
@@ -20,67 +20,17 @@
         {
             Tag = "Logic";
             
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.cycle,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-                //if (action != null)
-                //    action();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) => {
-                //if (action != null)
-                //    action();
-                RemoveFromParent();
-
-            };
+            #region  涓婇潰鐨勫竷灞�浠g爜
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.TextID = MyInternationalizationString.cycle;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             #endregion
-
-
 
 
             var middle = new FrameLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs
index cc4974c..867e73b 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs
@@ -21,60 +21,16 @@
         {
 
 
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(400),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.adddelay,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
+            #region  涓婇潰鐨勫竷灞�浠g爜
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.TextID = MyInternationalizationString.adddelay;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             #endregion
 
             var middle = new FrameLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs
deleted file mode 100644
index 6a87aa5..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceStateCondition.cs
+++ /dev/null
@@ -1,1600 +0,0 @@
-锘縰sing System;
-using Shared;
-using Shared.R;
-using System.Collections.Generic;
-using Newtonsoft.Json.Linq;
-using ZigBee.Device;
-using Shared.Common;
-
-
-namespace Shared.Phone.Device.Logic
-{
-    public class DeviceStateCondition : FrameLayout
-    {
-        public DeviceStateCondition()
-        {
-            Tag = "Logic";
-
-        }
-        Button roombjButton = new Button();
-        Button roomTextButton = new Button();
-        Button devicetypeButton = new Button();
-        VerticalScrolViewLayout middle;
-        FrameLayout clickframeLayout = new FrameLayout();
-        Button clickbutton = new Button();
-        Button clicktextcolcrbutton = new Button();
-       
-        public  void Show()
-        {
-
-     
-            UserView.HomePage.Instance.ScrollEnabled = false;
-            this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(160),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.devicestate,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var foolrname = new Button
-            {
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterRight,
-                X = Application.GetRealWidth(1080 - 400 - 120),
-                Width = Application.GetRealWidth(400),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                //TextID = MyInternationalizationString.customroom,
-                Text = Config.Instance.Home.GetCurrentFloorName,
-                TextSize = 14,
-            };
-            topRowLayout.AddChidren(foolrname);
-            var dropdown = new Button
-            {
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterRight,
-                X = foolrname.Right,
-                Width = Application.GetRealWidth(72),
-                Height = Application.GetRealHeight(72),
-                Y = Application.GetRealHeight(92),
-                UnSelectedImagePath = "ZigeeLogic/drop-down.png",
-            };
-            topRowLayout.AddChidren(dropdown);
-
-            #endregion
-
-            ///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱
-            if (Common.Room.Lists.Count == 0)
-            {
-                return;
-            }
-            ///鎴块棿婊戝姩鎺т欢
-            var roomhorizontalScrol = new HorizontalScrolViewLayout()
-            {
-                Width = Application.GetRealWidth(1080 - 58),
-                Height = Application.GetRealHeight(200),
-                Y = topRowLayout.Bottom,
-                X = Application.GetRealWidth(58),
-            };
-            this.AddChidren(roomhorizontalScrol);
-
-            ///璁惧绫诲瀷婊戝姩鎺т欢
-            var devicetypehorizontalScrol = new HorizontalScrolViewLayout()
-            {
-                Width = Application.GetRealWidth(1080 - 58),
-                Height = Application.GetRealHeight(280),
-                Y = roomhorizontalScrol.Bottom,
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                X = Application.GetRealWidth(58),
-               // Radius = (uint)Application.GetRealHeight(50),
-
-            };
-            this.AddChidren(devicetypehorizontalScrol);
-            devicetypehorizontalScrol.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerBottomLeft);
-
-            middle = new VerticalScrolViewLayout();
-            middle.Y = devicetypehorizontalScrol.Bottom + Application.GetRealHeight(40);
-            middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-            middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
-            middle.X = Application.GetRealWidth(58);
-            //middle.Radius = (uint)Application.GetRealHeight(50);
-            this.AddChidren(middle);
-            middle.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerTopLeft);
-            ///鐩墠鏀寔鐨勮澶�
-            var deviceTypeList = new List<DeviceType> {
-                DeviceType.IASZone,
-                DeviceType.OnOffSwitch,
-                DeviceType.OnOffOutput,//妤兼鐏�
-                DeviceType.DoorLock,
-                DeviceType.TemperatureSensor,
-            };
-
-            ///妤煎眰鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> foorlclick = (sender, e) =>
-            {
-
-                var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                this.AddChidren(flMain);
-                flMain.MouseUpEventHandler += (sender2, e2) =>
-                {
-                    flMain.RemoveFromParent();
-                };
-                var foolrbjicon = new FrameLayout
-                {
-
-                    Width = Application.GetRealWidth(450),
-                    Height = Application.GetRealHeight(780),
-                    X = Application.GetRealWidth(1080 - 468 - 35),
-                    Y = Application.GetRealHeight(184),
-                    BackgroundImagePath = "Item/SelectFloor_Right.png",
-                };
-                flMain.AddChidren(foolrbjicon);
-
-                var btnfoolrtext = new Button
-                {
-                    Width = Application.GetRealWidth(450),
-                    Height = Application.GetRealHeight(150),
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    X = Application.GetRealWidth(80),
-                    TextID = MyInternationalizationString.selecfoolr,
-                    TextSize = 14,
-                };
-                foolrbjicon.AddChidren(btnfoolrtext);
-
-                var foolrbj = new VerticalScrolViewLayout
-                {
-
-                    Width = Application.GetRealWidth(450),
-                    Height = foolrbjicon.Height - btnfoolrtext.Height,
-                    X = Application.GetRealWidth(80),
-                    Y = btnfoolrtext.Bottom,
-                };
-                foolrbjicon.AddChidren(foolrbj);
-
-                foreach (var foolr in Config.Instance.Home.FloorDics)
-                {
-                    var foolrRowLayout = new RowLayout
-                    {
-                        Height = Application.GetRealHeight(150),
-                        LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-                    };
-                    foolrbj.AddChidren(foolrRowLayout);
-
-                    var btnfoolricon = new Button
-                    {
-                        Width = Application.GetRealWidth(81),
-                        Height = Application.GetRealHeight(81),
-                        UnSelectedImagePath = "Floor/Floor.png",
-                        Gravity = Gravity.CenterVertical,
-                    };
-                    foolrRowLayout.AddChidren(btnfoolricon);
-
-
-                    var btnfoolrname = new Button
-                    {
-                        Width = Application.GetRealWidth(250),
-                        Height = Application.GetRealHeight(150),
-                        Text = foolr.Value,
-                        TextAlignment = TextAlignment.CenterLeft,
-                        TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                        Tag = foolr.Key,
-                        X = btnfoolricon.Right + Application.GetRealWidth(12),
-                        TextSize = 14,
-                    };
-                    foolrRowLayout.AddChidren(btnfoolrname);
-                    if (foolrname.Text == foolr.Value)
-                    {
-                        btnfoolricon.UnSelectedImagePath = "Floor/FloorSelected.png";
-                        btnfoolrname.TextColor = ZigbeeColor.Current.LogicTextBlackColor;
-                    }
-
-                    EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) =>
-                    {
-
-                        roomhorizontalScrol.RemoveAll();
-                        devicetypehorizontalScrol.RemoveAll();
-                        middle.RemoveAll();
-                        foolrname.Text = btnfoolrname.Text;
-                        flMain.RemoveFromParent();
-                        var list = Send.GetRoomList(btnfoolrname.Tag.ToString());
-                        AllRoomView(list, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
-                    };
-                    foolrRowLayout.MouseUpEventHandler += foolrnameclick;
-                    btnfoolrname.MouseUpEventHandler += foolrnameclick;
-
-
-                }
-
-            };
-            foolrname.MouseUpEventHandler += foorlclick;
-            dropdown.MouseUpEventHandler += foorlclick;
-            ///绗竴娆¤繘鏉�
-            var roomlists = new List<Common.Room>();
-            roomlists.Clear();
-            if (Config.Instance.Home.FloorDics.Count < 2)
-            {
-                foolrname.Visible = false;
-                dropdown.Visible = false;
-                if (Config.Instance.Home.FloorDics.Count == 0)
-                {
-                    roomlists.AddRange(Common.Room.Lists);
-                }
-                else
-                {
-                    roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
-                }
-            }
-            else
-            {
-                roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
-
-            }
-
-            AllRoomView(roomlists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
-        }
-        /// <summary>
-        /// 鍔犺浇鎵�鏈夋埧闂寸殑瑙嗗浘鏂规硶
-        /// </summary>
-        void AllRoomView(List<Common.Room> roomlist, List<DeviceType> deviceTypeList, HorizontalScrolViewLayout roomhorizontalScrol, HorizontalScrolViewLayout devicetypehorizontalScrol)
-        {
-            
-            for (int i = 0; i < roomlist.Count; i++)
-            {
-                var room = roomlist[i];
-
-                var fra = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(200),
-                    Width = Application.GetRealWidth(255),
-                };
-                roomhorizontalScrol.AddChidren(fra);
-
-                var roombjBtn = new Button
-                {
-                    Height = Application.GetRealHeight(158),
-                    Width = Application.GetRealWidth(255),
-                    UnSelectedImagePath = "ZigeeLogic/iconBackgroundColor.png",
-                    SelectedImagePath = "ZigeeLogic/iconSelectedBackgroundColor.png",
-                    Y = Application.GetRealHeight(21),
-                };
-                fra.AddChidren(roombjBtn);
-
-                var roomnameBtn = new Button
-                {
-
-                    Height = Application.GetRealHeight(152 - 26 - 20),
-                    Width = Application.GetRealWidth(255 - 20 - 50),
-                    Text = room.Name,
-                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                    SelectedTextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    Y = Application.GetRealHeight(21 + 13 + 10),
-                    X = Application.GetRealWidth(10 + 25),
-
-                };
-                fra.AddChidren(roomnameBtn);
-
-                if (i == 0)//
-                {
-                    roombjButton.IsSelected = false;
-                    roombjButton = roombjBtn;
-                    roombjBtn.IsSelected = true;
-
-                    roomTextButton.IsSelected = false;
-                    roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
-
-                    var list = new List<DeviceUI>();
-                    foreach (var device in room.DeviceUIList)
-                    {
-                        if (device.CommonDevice == null)
-                        {
-                            continue;
-                        }
-                        if (!deviceTypeList.Contains(device.CommonDevice.Type))
-                        {
-                            continue;
-                        }
-                        list.Add(device);
-                    }
-                    if (list.Count == 0)
-                    {
-                        devicetypehorizontalScrol.Height = 0;
-                        middle.Height = 0;
-                    }
-                    else
-                    {
-                        devicetypehorizontalScrol.Height = Application.GetRealHeight(280);
-                        middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-                    }
-
-                    AllDeviceTypeView(list, devicetypehorizontalScrol);
-
-                }
-
-
-                EventHandler<MouseEventArgs> roomclick = (sender, e) =>
-                {
-
-
-                    roombjButton.IsSelected = false;
-                    roombjButton = roombjBtn;
-                    roombjBtn.IsSelected = true;
-
-                    roomTextButton.IsSelected = false;
-                    roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
-
-                    var list = new List<DeviceUI>();
-                    foreach (var device in room.DeviceUIList)
-                    {
-                        if (device.CommonDevice == null)
-                        {
-                            continue;
-                        }
-                        if (!deviceTypeList.Contains(device.CommonDevice.Type))
-                        {
-                            continue;
-                        }
-                        list.Add(device);
-                    }
-
-                    if (list.Count == 0)
-                    {
-                        devicetypehorizontalScrol.Height = 0;
-                        middle.Height = 0;
-                    }
-                    else
-                    {
-                        devicetypehorizontalScrol.Height = Application.GetRealHeight(280);
-                        middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-                    }
-
-                    AllDeviceTypeView(list, devicetypehorizontalScrol);
-
-
-                };
-                roomnameBtn.MouseUpEventHandler += roomclick;
-                roombjBtn.MouseUpEventHandler += roomclick;
-
-            }
-        }
-        /// <summary>
-        /// 鍔犺浇璇ュ尯鍩熸墍鏈夎澶囪鍥炬柟娉�
-        /// </summary>0
-        /// <param name="devicelist">Devicelist.</param>
-        void AllDeviceTypeView(List<DeviceUI> devicelist, HorizontalScrolViewLayout devicetypehorizontalScrol)
-        {
-            List<string> devicetypelist = new List<string>();
-            devicetypelist.Clear();
-            #region  ------鎺掑垪璁惧绫诲瀷------
-            ///鏆傛椂闅愯棌鐏厜鍜岀獥甯樿澶�
-            var lightjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.ColorDimmableLight || device.CommonDevice.Type == DeviceType.OnOffOutput);
-            if (lightjosn != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Lights));
-            }
-            var curtainjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.WindowCoveringDevice);
-            if (curtainjosn != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains));
-            }
-
-            var iASZonejosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.IASZone || device.CommonDevice.Type == DeviceType.TemperatureSensor);
-            if (iASZonejosn != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.sensor));
-            }
-            var onOffSwitchjson = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.OnOffSwitch);
-            if (onOffSwitchjson != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.OnOffSwitch));
-            }
-            var doorLock = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.DoorLock);
-            if (doorLock != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.doorLock));
-            }
-            #endregion
-
-            devicetypehorizontalScrol.RemoveAll();
-            for (int i = 0; i < devicetypelist.Count; i++)
-            {
-
-                var devicetype = devicetypelist[i];
-
-                var spaceRowLayout = new FrameLayout();
-                devicetypehorizontalScrol.AddChidren(spaceRowLayout);
-                if (i == 0)
-                {
-                    spaceRowLayout.Width = Application.GetRealWidth(37);
-                }
-                else
-                {
-                    spaceRowLayout.Width = Application.GetRealWidth(80);
-                }
-
-                var deviceRowLayout = new FrameLayout
-                {
-                    Width = Application.GetRealWidth(156 + 20),
-                    Height = Application.GetRealHeight(280 - 30),
-                    Y = Application.GetRealHeight(30),
-                };
-                devicetypehorizontalScrol.AddChidren(deviceRowLayout);
-
-                var backgroundColor = new Button
-                {
-                    Width = Application.GetRealWidth(156),
-                    Height = Application.GetRealHeight(180),
-                    X = Application.GetRealWidth(10),
-                    UnSelectedImagePath = "ZigeeLogic/deviceunselectedbackgroundcolor.png",
-                    SelectedImagePath = "ZigeeLogic/deviceselectedbackgroundcolor.png",
-                };
-                deviceRowLayout.AddChidren(backgroundColor);
-
-
-                var devicetypeicon = new Button
-                {
-                    Width = Application.GetRealWidth(84),
-                    Height = Application.GetRealHeight(84),
-                    X = Application.GetRealWidth(46),
-                    Y = Application.GetRealHeight(30),
-                };
-                deviceRowLayout.AddChidren(devicetypeicon);
-
-                var devicetypename = new Button
-                {
-                    Width = Application.GetRealWidth(176),
-                    Height = Application.GetRealHeight(40),
-                    Text = devicetype,
-                    TextAlignment = TextAlignment.Center,
-                    Y = backgroundColor.Bottom,
-                    TextColor = ZigbeeColor.Current.LogicAddColor,
-                    TextSize = 10,
-                };
-                deviceRowLayout.AddChidren(devicetypename);
-                if (devicetype == Language.StringByID(MyInternationalizationString.Lights))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedlight.png";
-                    // devicetypeicon.SelectedImagePath = "ZigeeLogic/LightSelected.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.Curtains))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedcurtain.png";
-                    //devicetypeicon.SelectedImagePath = "ZigeeLogic/CurtainSelected.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.OnOffSwitch))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedpanel.png";
-                    // devicetypeicon.SelectedImagePath = "ZigeeLogic/OnOffSwitchSelected.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.sensor))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedsenor.png";
-                    // devicetypeicon.SelectedImagePath = "ZigeeLogic/SensorSelected.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.doorLock))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selecteddoorlock.png";
-                }
-                EventHandler<MouseEventArgs> devicetypeclick = (sender13, e13) =>
-                {
-                    List<DeviceType> list = new List<DeviceType>();
-                    list.Clear();
-                    devicetypeButton.IsSelected = false;
-                    devicetypeButton = backgroundColor;
-                    backgroundColor.IsSelected = true;
-                    ///鍒嗙被鏄剧ず锛堜緥濡傜伅鍏夛細{鐏厜1锛岀伅鍏�2...}锛�
-                    if (devicetype == Language.StringByID(MyInternationalizationString.Lights))
-                    {
-                        list.Add(DeviceType.OnOffOutput);//0x0101鍗佽繘鍒�257
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.Curtains))
-                    {
-                        list.Add(DeviceType.WindowCoveringDevice);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.OnOffSwitch))
-                    {
-                        list.Add(DeviceType.OnOffSwitch);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.sensor))
-                    {
-                        list.Add(DeviceType.IASZone);
-                        list.Add(DeviceType.TemperatureSensor);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.doorLock))
-                    {
-                        list.Add(DeviceType.DoorLock);
-                    }
-
-                    ConditionDeviceView(list, devicelist);
-
-                };
-                deviceRowLayout.MouseUpEventHandler += devicetypeclick;
-                devicetypename.MouseUpEventHandler += devicetypeclick;
-                devicetypeicon.MouseUpEventHandler += devicetypeclick;
-                backgroundColor.MouseUpEventHandler += devicetypeclick;
-
-            }
-            ///鏄剧ず鎴块棿鎵�鏈夎澶�
-            ConditionDeviceView(new List<DeviceType>(), devicelist);
-
-        }
-        /// <summary>
-        /// 鍔犺浇璇ョ被鍨嬭澶囪鍥炬柟娉�
-        /// </summary>
-        /// <param name="deviceTypelist">Device typelist.</param>
-        /// <param name="devicelist">璁惧鍒楄〃</param>
-        void ConditionDeviceView(List<DeviceType> deviceTypelist, List<DeviceUI> devicelist)
-        {
-            middle.RemoveAll();
-
-            foreach (var common in devicelist)
-            {
-
-                if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.CommonDevice.Type))
-                {
-                    continue;
-                }
-
-
-                var deviceFramelayout = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(160),
-                };
-                middle.AddChidren(deviceFramelayout);
-
-                var bjFramelayout = new FrameLayout
-                {
-                    Width = Application.GetRealWidth(112),
-                    Height = Application.GetRealHeight(112),
-                    X = Application.GetRealWidth(58),
-                    Y = Application.GetRealHeight(30 + 9),
-                   // Radius = (uint)Application.GetRealHeight(56),
-                    BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-                };
-                deviceFramelayout.AddChidren(bjFramelayout);
-
-                var deviceIconBtn = new Button
-                {
-                    Width = Application.GetRealWidth(82),
-                    Height = Application.GetRealHeight(82),
-                    Gravity = Gravity.Center,
-
-                };
-                bjFramelayout.AddChidren(deviceIconBtn);
-
-                var deviceRow = new RowLayout
-                {
-                    Y = Application.GetRealHeight(30),
-                    Width = Application.GetRealWidth(850),
-                    Height = Application.GetRealHeight(130),
-                    X = Application.GetRealWidth(176 + 10),
-                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-
-                };
-                deviceFramelayout.AddChidren(deviceRow);
-
-                var devicename = new Button
-                {
-                    Text = common.CommonDevice.DeviceEpointName,
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    SelectedTextColor = ZigbeeColor.Current.LogicAddColor,
-                    TextSize = 14,
-                };
-                deviceRow.AddChidren(devicename);
-                switch (common.CommonDevice.Type)
-                {
-                    case DeviceType.OnOffOutput:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/light.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedlight.png";
-                        }
-                        break;
-                    case DeviceType.IASZone:
-                        {
-                            var iASZonedevice = common.CommonDevice as IASZone;
-                            if (iASZonedevice.DeviceID != 1026)
-                            {
-                                break;
-                            }
-                            deviceIconBtn.UnSelectedImagePath = $"ZigeeLogic/sensor{iASZonedevice.IasDeviceType}.png";
-                            deviceIconBtn.SelectedImagePath = $"ZigeeLogic/selectedsensor{iASZonedevice.IasDeviceType}.png";
-
-
-                        }
-                        break;
-                    case DeviceType.TemperatureSensor:
-                        {
-                            var temperatureSensor = common.CommonDevice as TemperatureSensor;
-                            if (temperatureSensor.SensorDiv == 1)
-                            {
-                                deviceIconBtn.UnSelectedImagePath = $"ZigeeLogic/temperature.png";
-                                deviceIconBtn.SelectedImagePath = $"ZigeeLogic/selectedtemperature.png";
-                            }
-                            else
-                            {
-                                deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/humidity.png";
-                                deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedhumidity.png";
-                            }
-                        }
-                        break;
-                    case DeviceType.OnOffSwitch:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/panel.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedpanel.png";
-                        }
-                        break;
-                    case DeviceType.DoorLock:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/doorlock.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selecteddoorlock.png";
-                        }
-                        break;
-                }
-
-                EventHandler<MouseEventArgs> devicclick = (sen, e) =>
-                {
-                    clickbutton.IsSelected = false;
-                    clickbutton = deviceIconBtn;
-                    deviceIconBtn.IsSelected = true;
-                    clickframeLayout.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-                    clickframeLayout = bjFramelayout;
-                    bjFramelayout.BackgroundColor = ZigbeeColor.Current.LogicIconBackgroundColor;
-                    clicktextcolcrbutton.IsSelected = false;
-                    clicktextcolcrbutton = devicename;
-                    devicename.IsSelected = true;
-                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                    this.AddChidren(flMain);
-                    CurrentDeviceView(flMain, common.CommonDevice, false);
-                };
-                deviceFramelayout.MouseUpEventHandler += devicclick;
-                bjFramelayout.MouseUpEventHandler += devicclick;
-                deviceIconBtn.MouseUpEventHandler += devicclick;
-                deviceRow.MouseUpEventHandler += devicclick;
-                devicename.MouseUpEventHandler += devicclick;
-
-
-            }
-        }
-        /// <summary>
-        /// 閫変腑璇ヨ澶囧姛鑳戒綔涓烘潯浠剁殑瑙嗗浘鏂规硶
-        /// </summary>
-        /// <param name="common">Common.</param>
-        public async static void CurrentDeviceView(FrameLayout flMain, CommonDevice common, bool edit)
-        {
-            //涓嶈褰撳墠鐣岄潰婊戝姩
-            UserView.HomePage.Instance.ScrollEnabled = false;
-            List<Dictionary<string, string>> doorlockConditionsInfo = new List<Dictionary<string, string>>();
-            Dictionary<string, string> deviceConditionsInfo = new Dictionary<string, string>();
-            dictionary(deviceConditionsInfo, "Type", "1");
-            dictionary(deviceConditionsInfo, "IsValid", "1");
-            dictionary(deviceConditionsInfo, "MacAddr", common.DeviceAddr);
-            dictionary(deviceConditionsInfo, "Epoint", common.DeviceEpoint.ToString());
-            //var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-            //this.AddChidren(flMain);
-            flMain.MouseUpEventHandler += (sender, e) =>
-            {
-                flMain.RemoveFromParent();
-            };
-
-            var devicefra = new FrameLayout
-            {
-
-                Width = Application.GetRealWidth(1080),
-                Height = Application.GetRealHeight(530),
-                Y = Application.GetRealHeight(1920 - 530),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-               // Radius = (uint)Application.GetRealHeight(60),
-            };
-            flMain.AddChidren(devicefra);
-            devicefra.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerTopRight);
-
-            #region  -------鍙栨秷   瀹屾垚
-            var timetype = new RowLayout
-            {
-                Height = Application.GetRealHeight(140),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            devicefra.AddChidren(timetype);
-            var Btncancel = new Button
-            {
-                TextID = MyInternationalizationString.cancel,
-                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                X = Application.GetRealWidth(80),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextSize = 14,
-            };
-            timetype.AddChidren(Btncancel);
-            Btncancel.MouseUpEventHandler += (sender16, e16) =>
-            {
-                flMain.RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var Btntitle = new Button
-            {
-                TextID = MyInternationalizationString.security,
-                TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(420),
-                TextAlignment = TextAlignment.Center,
-                X = Btncancel.Right + Application.GetRealWidth(50),
-                TextSize = 16,
-                Text = common.DeviceEpointName,
-            };
-            timetype.AddChidren(Btntitle);
-            var Btncomplete = new Button
-            {
-                TextID = MyInternationalizationString.complete,
-                TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                TextAlignment = TextAlignment.CenterRight,
-                X = Btntitle.Right + Application.GetRealWidth(50),
-                TextSize = 14,
-
-            };
-            timetype.AddChidren(Btncomplete);
-            #endregion
-
-            string SelectedDeviceStatuscondition = "";
-
-            Dictionary<string, string> devices = null;
-            if (edit)
-            {
-                foreach (var deviceinfo in Common.Logic.CurrentLogic.Conditions)
-                {
-                    if (deviceinfo["Type"] == "1")
-                    {
-                        if (common.DeviceAddr == deviceinfo["MacAddr"] && common.DeviceEpoint.ToString() == deviceinfo["Epoint"])
-                        {
-                            devices = deviceinfo;
-                            break;
-
-                        }
-                    }
-                }
-            }
-            switch (common.Type)
-            {
-                ///鐏厜
-                case DeviceType.OnOffOutput:
-                    {
-                        dictionary(deviceConditionsInfo, "Cluster_ID", "6");
-                        dictionary(deviceConditionsInfo, "AttriButeId", "0");
-                        dictionary(deviceConditionsInfo, "Range", "1");
-                        dictionary(deviceConditionsInfo, "AttriButeData2", "0");
-
-                        #region  鐏厜View
-
-
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-
-
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = openframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-                        #endregion
-
-                        ///鐐瑰嚮纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            btnopen.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                            btnclose.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                            SelectedDeviceStatuscondition = "OnOffOutput";
-                            dictionary(deviceConditionsInfo, "AttriButeData1", "1");//榛樿鍊�
-
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-                        ///鐐瑰嚮鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            btnopen.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                            btnclose.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-                            SelectedDeviceStatuscondition = "OnOffOutput";
-                            dictionary(deviceConditionsInfo, "AttriButeData1", "0");//榛樿鍊�
-
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-                        if (edit && devices != null)
-                        {
-                            if (devices["AttriButeId"] == "0")
-                            {
-                                if (devices["AttriButeData1"] == "1")
-                                {
-                                    btnopen.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                                    btnclose.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                    openBtnSelected.Visible = true;
-                                    closeBtnSelected.Visible = false;
-                                }
-                                else
-                                {
-                                    btnopen.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                    btnclose.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                                    openBtnSelected.Visible = false;
-                                    closeBtnSelected.Visible = true;
-
-                                }
-                            }
-                        }
-                    }
-                    break;
-                case DeviceType.WindowCoveringDevice:
-                    {
-
-                        dictionary(deviceConditionsInfo, "Cluster_ID", "258");
-                        dictionary(deviceConditionsInfo, "AttriButeId", "8");
-                        dictionary(deviceConditionsInfo, "Range", "0");
-                        dictionary(deviceConditionsInfo, "AttriButeData2", "0");
-
-                        #region 绐楀笜View
-                        devicefra.Y = Application.GetRealHeight(1920 - 30 - 720);
-                        devicefra.Height = Application.GetRealHeight(720);
-                        var windowCoveringfra = new FrameLayout
-                        {
-                            Y = Application.GetRealHeight(180),
-                            Height = Application.GetRealHeight(180 * 2 + 30),
-                        };
-                        devicefra.AddChidren(windowCoveringfra);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Height = Application.GetRealHeight(180),
-                        };
-                        windowCoveringfra.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            //Text = "寮�",
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            X = Application.GetRealWidth(50),
-                            Width = Application.GetRealWidth(300),
-                            Height = Application.GetRealHeight(180),
-                            //SelectedBackgroundColor = 0xfffe5e00,
-                            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new Button
-                        {
-                            X = Application.GetRealWidth(1000 - 150),
-                            Width = Application.GetMinRealAverage(110),
-                            Height = Application.GetMinRealAverage(110),
-                            UnSelectedImagePath = "Item/YesSelected.png",
-                            Visible = false,
-                            Gravity = Gravity.CenterVertical
-                        };
-                        openrowlayout.AddChidren(openBtnSelected);
-
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = openrowlayout.Bottom,
-                            Height = Application.GetRealHeight(180),
-                        };
-                        windowCoveringfra.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            X = Application.GetRealWidth(50),
-                            Width = Application.GetRealWidth(300),
-                            Height = Application.GetRealHeight(180),
-                            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new Button
-                        {
-                            X = Application.GetRealWidth(1000 - 150),
-                            Width = Application.GetMinRealAverage(110),
-                            Height = Application.GetMinRealAverage(110),
-                            UnSelectedImagePath = "Item/YesSelected.png",
-                            Visible = false,
-                            Gravity = Gravity.CenterVertical
-                        };
-                        closerowlayout.AddChidren(closeBtnSelected);
-                        #endregion
-
-                        ///鐐瑰嚮纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatuscondition = "WindowCoveringDevice";
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            dictionary(deviceConditionsInfo, "AttriButeData1", "95");//榛樿鍊�
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        ///鐐瑰嚮鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatuscondition = "WindowCoveringDevice";
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-                            dictionary(deviceConditionsInfo, "AttriButeData1", "5");//榛樿鍊�
-
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-
-                        if (edit && devices != null)
-                        {
-                            if (devices["AttriButeId"] == "8")
-                            {
-                                if (int.Parse(devices["AttriButeData1"]) > 5)
-                                {
-                                    openBtnSelected.Visible = true;
-                                    closeBtnSelected.Visible = false;
-                                }
-                                else
-                                {
-                                    openBtnSelected.Visible = false;
-                                    closeBtnSelected.Visible = true;
-                                }
-                            }
-                        }
-                    }
-                    break;
-                case DeviceType.IASZone:
-                    {
-
-                        var iASZonedevice = common as IASZone;
-                        if (iASZonedevice.DeviceID != 1026)
-                        {
-                            break;
-                        }
-
-                        dictionary(deviceConditionsInfo, "Cluster_ID", "1280");
-                        dictionary(deviceConditionsInfo, "AttriButeId", "1281");
-                        dictionary(deviceConditionsInfo, "AttriButeData2", "0");
-
-                        #region  瀹夐槻璁惧View
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-
-
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = openframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-
-
-                        #endregion
-
-                        int timevalue = 0;
-                        ///鐐瑰嚮纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatuscondition = "IASZone";
-                            btnopen.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                            btnclose.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            if (iASZonedevice.IasDeviceType == 13)
-                            {
-                                closeBtnSelected.Visible = true;
-                            }
-                            dictionary(deviceConditionsInfo, "Range", "5");
-                            dictionary(deviceConditionsInfo, "AttriButeData1", "1");
-
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-                        ///鐐瑰嚮鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatuscondition = "IASZone";
-                            btnopen.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                            btnclose.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-                            dictionary(deviceConditionsInfo, "Range", "1");
-                            dictionary(deviceConditionsInfo, "AttriButeData1", "0");
-                            if (iASZonedevice.IasDeviceType == 13)
-                            {
-                                SelectedDeviceStatuscondition = "";
-                                btnopen.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                btnclose.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                openBtnSelected.Visible = false;
-                                closeBtnSelected.Visible = true;
-                                var ignoreTime = new IgnoreTime();
-                                UserView.HomePage.Instance.AddChidren(ignoreTime);
-                                UserView.HomePage.Instance.PageIndex += 1;
-                                ignoreTime.Show(common, btnclose.Text, edit, timevalue);
-                            }
-
-
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-
-
-
-                        switch (iASZonedevice.IasDeviceType)
-                        {
-                            case 13:
-                                {
-                                    btnopen.TextID = MyInternationalizationString.someone;
-                                    btnclose.TextID = MyInternationalizationString.unattendedtime1;
-                                    closeBtnSelected.UnSelectedImagePath = "ZigeeLogic/next.png";
-                                    closeBtnSelected.Visible = true;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    closeframelayout.AddChidren(closerowlayout);
-                                }
-                                break;
-                            case 21:
-                            case 22:
-                                {
-                                    #region
-                                    devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 * 3 - 20 - 50);
-                                    devicefra.Height = Application.GetRealHeight(140 + 160 * 3 + 20 + 50);
-                                    btnopen.TextID = MyInternationalizationString.logicopen;
-                                    btnclose.TextID = MyInternationalizationString.logicclose;
-                                    closerowlayout.LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    closeframelayout.AddChidren(closerowlayout);
-
-
-
-                                    var timeoutframelayout = new FrameLayout
-                                    {
-                                        Height = Application.GetRealHeight(160),
-                                        Y = closeframelayout.Bottom,
-                                    };
-                                    devicefra.AddChidren(timeoutframelayout);
-                                    var timeoutrowlayout = new RowLayout
-                                    {
-                                        Y = Application.GetRealHeight(30),
-                                        Width = Application.GetRealWidth(920),
-                                        Height = Application.GetRealHeight(130),
-                                        X = Application.GetRealWidth(80),
-                                        LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                                    };
-                                    timeoutframelayout.AddChidren(timeoutrowlayout);
-
-                                    var btntimeout = new Button
-                                    {
-                                        TextID = MyInternationalizationString.closetimeout,
-                                        Width = Application.GetRealWidth(600),
-                                        TextAlignment = TextAlignment.CenterLeft,
-                                        TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                                        TextSize = 14,
-                                    };
-                                    timeoutrowlayout.AddChidren(btntimeout);
-
-                                    var timeoutBtnSelected = new Button
-                                    {
-                                        X = Application.GetRealWidth(860),
-                                        Width = Application.GetMinRealAverage(60),
-                                        Height = Application.GetMinRealAverage(60),
-                                        UnSelectedImagePath = "ZigeeLogic/next.png",
-                                        Gravity = Gravity.CenterVertical,
-                                    };
-                                    timeoutrowlayout.AddChidren(timeoutBtnSelected);
-                                    EventHandler<MouseEventArgs> timeoutclick = (sender, e) =>
-                                    {
-                                        SelectedDeviceStatuscondition = "";
-                                        btnopen.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                        btnclose.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = false;
-                                        var ignoreTime = new IgnoreTime();
-                                        UserView.HomePage.Instance.AddChidren(ignoreTime);
-                                        UserView.HomePage.Instance.PageIndex += 1;
-                                        ignoreTime.Show(common, btntimeout.Text, edit, timevalue);
-
-                                    };
-                                    timeoutframelayout.MouseUpEventHandler += timeoutclick;
-                                    timeoutrowlayout.MouseUpEventHandler += timeoutclick;
-                                    btntimeout.MouseUpEventHandler += timeoutclick;
-                                    timeoutBtnSelected.MouseUpEventHandler += timeoutclick;
-
-                                    #endregion
-                                }
-                                break;
-                            case 40:
-                                {
-                                    devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 - 20 - 50);
-                                    devicefra.Height = Application.GetRealHeight(140 + 160 + 20 + 50);
-                                    btnopen.TextID = MyInternationalizationString.smokescreen;
-                                    //btnclose.TextID = MyInternationalizationString.nosmokescreen;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    openrowlayout.LineColor = ZigbeeColor.Current.LogicBackgroundColor;
-                                }
-                                break;
-                            case 42:
-                                {
-                                    btnopen.TextID = MyInternationalizationString.waterleakage;
-                                    btnclose.TextID = MyInternationalizationString.noleakage;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    closeframelayout.AddChidren(closerowlayout);
-
-                                }
-                                break;
-                            case 43:
-                                {
-                                    devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 - 20 - 50);
-                                    devicefra.Height = Application.GetRealHeight(140 + 160 + 20 + 50);
-                                    btnopen.TextID = MyInternationalizationString.gas;
-                                    //btnclose.TextID = MyInternationalizationString.nogas;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    openrowlayout.LineColor = ZigbeeColor.Current.LogicBackgroundColor;
-                                }
-                                break;
-                            case 44:
-                                {
-                                    devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 - 20 - 50);
-                                    devicefra.Height = Application.GetRealHeight(140 + 160 + 20 + 50);
-                                    btnopen.TextID = MyInternationalizationString.emergencybutton;
-                                    //btnclose.TextID = MyInternationalizationString.nosmokescreen;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    openrowlayout.LineColor = ZigbeeColor.Current.LogicBackgroundColor;
-                                }
-                                break;
-                            case 277:
-                                {
-                                    devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 - 20 - 50);
-                                    devicefra.Height = Application.GetRealHeight(140 + 160 + 20 + 50);
-                                    btnopen.TextID = MyInternationalizationString.callthepolice;
-                                    //btnclose.TextID = MyInternationalizationString.nosmokescreen;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    openrowlayout.LineColor = ZigbeeColor.Current.LogicBackgroundColor;
-                                }
-                                break;
-                            default:
-                                {
-                                    devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 - 20 - 50);
-                                    devicefra.Height = Application.GetRealHeight(140 + 160 + 20 + 50);
-                                    btnopen.TextID = MyInternationalizationString.callthepolice;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    openrowlayout.LineColor = ZigbeeColor.Current.LogicBackgroundColor;
-                                }
-                                break;
-                        }
-                        if (edit && devices != null)
-                        {
-                            if (devices["AttriButeId"] == "1281")
-                            {
-                                if (devices["AttriButeData1"] == "1")
-                                {
-                                    btnopen.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                                    btnclose.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                    openBtnSelected.Visible = true;
-                                    closeBtnSelected.Visible = false;
-                                }
-                                else
-                                {
-                                    if (devices.ContainsKey("IgnoreTime"))
-                                    {
-                                        timevalue = int.Parse(devices["IgnoreTime"]);
-                                    }
-                                    else
-                                    {
-                                        btnopen.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                        btnclose.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = true;
-                                    }
-                                }
-                            }
-
-
-                        }
-
-                    }
-                    break;
-                case DeviceType.OnOffSwitch:
-                    {
-
-                        dictionary(deviceConditionsInfo, "Cluster_ID", "1282");
-                        dictionary(deviceConditionsInfo, "AttriButeId", "1283");
-                        dictionary(deviceConditionsInfo, "Range", "0");//鎸夐敭鐗规畩
-                        dictionary(deviceConditionsInfo, "AttriButeData1", "0");
-                        dictionary(deviceConditionsInfo, "AttriButeData2", "0");
-
-                        devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 - 20 - 50);
-                        devicefra.Height = Application.GetRealHeight(140 + 160 + 20 + 50);
-                        var OnOffOutputfra = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(OnOffOutputfra);
-
-                        var buttonRow = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        OnOffOutputfra.AddChidren(buttonRow);
-
-                        var button = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            Text = Language.StringByID(MyInternationalizationString.OnOffSwitch) + common.DeviceEpoint.ToString(),
-                            TextSize = 14,
-                            //SelectedBackgroundColor = 0xfffe5e00,
-                        };
-                        buttonRow.AddChidren(button);
-
-                        var buttonSelected = new SelectedButton();
-                        buttonRow.AddChidren(buttonSelected);
-                        EventHandler<MouseEventArgs> buttonclick = (sender, e) =>
-                        {
-                            buttonSelected.Visible = true;
-                            SelectedDeviceStatuscondition = "OnOffSwitch";
-                            button.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-
-                        };
-                        buttonRow.MouseUpEventHandler += buttonclick;
-                        button.MouseUpEventHandler += buttonclick;
-                        buttonSelected.MouseUpEventHandler += buttonclick;
-                        OnOffOutputfra.MouseUpEventHandler += buttonclick;
-
-                        if (edit && devices != null)
-                        {
-                            buttonSelected.Visible = true;
-                            button.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                        }
-
-                    }
-                    break;
-                case DeviceType.DoorLock:
-                    {
-
-                        flMain.RemoveFromParent();
-                        var memberList = new MemberList();
-                        UserView.HomePage.Instance.AddChidren(memberList);
-                        UserView.HomePage.Instance.PageIndex += 1;
-                        MemberList.edit = false;
-                        memberList.Show(common);
-                    }
-                    break;
-                case DeviceType.TemperatureSensor:
-                    {
-                        string current = Language.StringByID(MyInternationalizationString.current);
-                        devicefra.Y = Application.GetRealHeight(1920 - 140 - 600);
-                        devicefra.Height = Application.GetRealHeight(140 + 600);
-                        var temperatureSensor = common as TemperatureSensor;
-                        SelectedDeviceStatuscondition = "TemperatureSensor";
-                        #region  甯冨眬View
-                        var PickerViewfra = new FrameLayout
-                        {
-                            Y = Application.GetRealHeight(140),
-                            Height = Application.GetRealHeight(600),
-                        };
-                        devicefra.AddChidren(PickerViewfra);
-
-
-                        var mUIPickerView = new UIPickerView
-                        {
-                            Height = Application.GetRealHeight(600 - 5),
-                        };
-                        PickerViewfra.AddChidren(mUIPickerView);
-
-                        var mList1 = new List<string> { ">", "<", "=", "鈮�", "鈮�" };
-                        var mList2 = new List<string>();
-                        var mList3 = new List<string>();
-                        for (int i = 1; i <=100; i++)
-                        {
-                            mList2.Add(i.ToString());
-                        }
-                        if (temperatureSensor.SensorDiv == 1) {
-                            mList3.Add("鈩�");
-                            dictionary(deviceConditionsInfo, "Cluster_ID", "1026");
-                            dictionary(deviceConditionsInfo, "AttriButeId", "0");
-                            dictionary(deviceConditionsInfo, "Range", "1");//1:绛変簬AttriButeData1鏃惰Е鍙戝姩浣�
-                            dictionary(deviceConditionsInfo, "AttriButeData1", "50");//榛樿娓╁害鍊�50鈩�
-                            dictionary(deviceConditionsInfo, "AttriButeData2", "0");
-                        } else {
-                            mList3.Add("%");
-                            dictionary(deviceConditionsInfo, "Cluster_ID", "1029");
-                            dictionary(deviceConditionsInfo, "AttriButeId", "0");
-                            dictionary(deviceConditionsInfo, "Range", "1");//1:绛変簬AttriButeData1鏃惰Е鍙戝姩浣�
-                            dictionary(deviceConditionsInfo, "AttriButeData1", "50");//榛樿婀垮害鍊�50%
-                            dictionary(deviceConditionsInfo, "AttriButeData2", "0");
-                        }
-                        mUIPickerView.setNPicker(mList1, mList2, mList3);
-
-                        #endregion
-
-                        mUIPickerView.OnSelectChangeEvent += (s1, s2, s3) =>
-                        {
-                            SelectedDeviceStatuscondition = "TemperatureSensor";
-                            dictionary(deviceConditionsInfo, "AttriButeData1", mList2[s2]);
-                            switch (mList1[s1])
-                            {
-                                case ">": {
-                                        dictionary(deviceConditionsInfo, "Range", "0");
-                                    } break;
-                                case "<": {
-                                        dictionary(deviceConditionsInfo, "Range", "2");
-                                    } break;
-                                case "=": {
-                                        dictionary(deviceConditionsInfo, "Range", "1");
-                                    } break;
-                                case "鈮�": {
-                                        dictionary(deviceConditionsInfo, "Range", "6");
-                                    } break;
-                                case "鈮�": {
-                                        dictionary(deviceConditionsInfo, "Range", "7");
-                                    } break;
-                            }
-                        };
-
-                        //榛樿=,50
-                        int index1 = 2, index2 = 49;
-                        if (edit && devices != null)
-                        {
-                            SelectedDeviceStatuscondition = "";
-                            string s = "";
-                            switch (devices["Range"])
-                            {
-                                case "0":
-                                    {
-                                        s = ">";
-                                    }
-                                    break;
-                                case "1":
-                                    {
-                                        s = "=";
-                                    }
-                                    break;
-                                case "2":
-                                    {
-                                        s = "<";
-                                    }
-                                    break;
-                                case "6":
-                                    {
-                                        s = "鈮�";
-                                    }
-                                    break;
-                                case "7":
-                                    {
-                                        s = "鈮�";
-                                    }
-                                    break;
-                            }
-                            //鏌ユ壘绱㈠紩
-                            index1 = mList1.IndexOf(s);
-                            index2 = mList2.IndexOf(devices["AttriButeData1"]);
-
-                        }
-                        ///鏇存柊鏈�鏂扮姸鎬侊紱
-                        mUIPickerView.setCurrentItems(index1, index2, 0);
-
-                    }
-                    break;
-            }
-
-            Btncomplete.MouseUpEventHandler += (sender2, e2) =>
-            {
-                //UserView.HomePage.Instance.ScrollEnabled = true;
-                if (SelectedDeviceStatuscondition != "")
-                {
-                    LogicIfon.AddDeviceconditions(common, deviceConditionsInfo);
-                }
-                else
-                {
-                    if (!edit)
-                    {
-                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
-                                    Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
-                                   Language.StringByID(MyInternationalizationString.confrim));
-                        alert.Show();
-                        return;
-                    }
-
-                }
-                flMain.RemoveFromParent();
-                var logicCommunalPage = new LogicCommunalPage();
-                UserView.HomePage.Instance.AddChidren(logicCommunalPage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                logicCommunalPage.Show(() => { });
-
-            };
-
-
-        }
-
-        public static void dictionary(Dictionary<string, string> deviceConditionsInfo, string Key, string Value)
-        {
-            if (deviceConditionsInfo.ContainsKey(Key))
-            {
-                deviceConditionsInfo.Remove(Key);
-            }
-            deviceConditionsInfo.Add(Key, Value);
-        }
-
-
-
-    }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs
index 56ff12d..93a3a2a 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs
@@ -19,364 +19,86 @@
         {
 
             #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
 
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.addaction,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent();
-            };
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.TextID = MyInternationalizationString.addaction;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             #endregion
 
-            
+
             var middle = new FrameLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
 
-            #region ----- 璁惧------    
-            var deviceframelayout = new FrameLayout
+            #region ----- 璁惧------
+
+            FunView deviceview= new FunView();
+            deviceview.iconBtn.UnSelectedImagePath = "ZigeeLogic/function.png";
+            deviceview.funnameBtn.TextID = MyInternationalizationString.device;
+            middle.AddChidren(deviceview.FunFrameView());
+            deviceview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(deviceframelayout);
-
-            var deviceiconBtn = new Button
-            {
-                Width = Application.GetRealWidth(81),
-                Height = Application.GetRealHeight(81),
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-                UnSelectedImagePath = "ZigeeLogic/function.png",
-
-            };
-            deviceframelayout.AddChidren(deviceiconBtn);
-
-            var devicerow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            deviceframelayout.AddChidren(devicerow);
-
-
-            var btndevice = new Button
-            {
-                TextID = MyInternationalizationString.device,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-               TextSize=15,
-            };
-            devicerow.AddChidren(btndevice);
-
-            var btndeviceback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                X = Application.GetRealWidth(789),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-
-            };
-            devicerow.AddChidren(btndeviceback);
-
-            EventHandler<MouseEventArgs> devicestateclick = (sender, e) =>
-            {
-                var logicDevicePage = new LogicDevicePage();
-                UserView.HomePage.Instance.AddChidren(logicDevicePage);
+                var roomAndDeviceView = new RoomAndDeviceView();
+                UserView.HomePage.Instance.AddChidren(roomAndDeviceView);
                 UserView.HomePage.Instance.PageIndex += 1;
-                logicDevicePage.Show();
-
+                roomAndDeviceView.IfType = LogicView.IfString.Action_Logic;
+                roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.addaction));
             };
-            deviceframelayout.MouseUpEventHandler += devicestateclick;
-            btndevice.MouseUpEventHandler += devicestateclick;
-            btndeviceback.MouseUpEventHandler += devicestateclick;
-            deviceiconBtn.MouseUpEventHandler += devicestateclick;
-            devicerow.MouseUpEventHandler += devicestateclick;
+
             #endregion
 
             #region ----- 鍦烘櫙------
-
-
-            var sceneframelayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                Y= deviceframelayout.Bottom,
-            };
-            middle.AddChidren(sceneframelayout);
-
-            var sceneiconBtn = new Button
-            {
-                Width = Application.GetRealWidth(81),
-                Height = Application.GetRealHeight(81),
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-                UnSelectedImagePath = "ZigeeLogic/scene.png",
-
-            };
-            sceneframelayout.AddChidren(sceneiconBtn);
-
-
-            var sceneRowLayout = new RowLayout {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            sceneframelayout.AddChidren (sceneRowLayout);
-
-            var scene = new Button {
-                TextID = MyInternationalizationString.scene,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-            };
-            sceneRowLayout.AddChidren (scene);
-
-            var btnsceneback = new Button {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                X = Application.GetRealWidth(789),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-            };
-            sceneRowLayout.AddChidren (btnsceneback);
-
-            EventHandler<MouseEventArgs> sceneclick = (sender, e) =>
+            FunView sceneview= new FunView();
+            sceneview.iconBtn.UnSelectedImagePath = "ZigeeLogic/scene.png";
+            sceneview.funnameBtn.TextID = MyInternationalizationString.scene;
+            sceneview.funFrameLayout.Y = deviceview.funFrameLayout.Bottom;
+            middle.AddChidren(sceneview.FunFrameView());
+            sceneview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
                 var addScenePage = new AddScenePage();
                 UserView.HomePage.Instance.AddChidren(addScenePage);
                 UserView.HomePage.Instance.PageIndex += 1;
-                addScenePage.Show();
+                addScenePage.Show(LogicView.IfString.Action_LogicScene);
             };
-             sceneRowLayout.MouseUpEventHandler += sceneclick;
-             scene.MouseUpEventHandler += sceneclick;
-             btnsceneback.MouseUpEventHandler += sceneclick;
-            sceneframelayout.MouseUpEventHandler += sceneclick;
-            sceneiconBtn.MouseUpEventHandler += sceneclick;
             #endregion
 
-            #region ----- 瀹夐槻妯″紡------        
-            var securityframelayout = new FrameLayout
+            #region ----- 瀹夐槻妯″紡------
+            FunView securityview= new FunView();
+            securityview.iconBtn.UnSelectedImagePath = "ZigeeLogic/security.png";
+            securityview.funnameBtn.TextID = MyInternationalizationString.securitymode;
+            securityview.funFrameLayout.Y = sceneview.funFrameLayout.Bottom;
+            middle.AddChidren(securityview.FunFrameView());
+            securityview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                Height = Application.GetRealHeight(160),
-                Y = sceneframelayout.Bottom,
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(securityframelayout);
-
-            var securityiconBtn = new Button
-            {
-                Width = Application.GetRealWidth(81),
-                Height = Application.GetRealHeight(81),
-                UnSelectedImagePath = "ZigeeLogic/security.png",
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-            };
-            securityframelayout.AddChidren(securityiconBtn);
-
-            var securityrow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            securityframelayout.AddChidren(securityrow);
-
-
-            var btnsecurity = new Button
-            {
-                TextAlignment = TextAlignment.CenterLeft,
-                TextID = MyInternationalizationString.securitymode,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-            };
-            securityrow.AddChidren(btnsecurity);
-
-            var btnsecurityback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = Application.GetRealWidth(789),
-                Gravity = Gravity.CenterVertical,
-            };
-            securityrow.AddChidren(btnsecurityback);
-
-            EventHandler<MouseEventArgs> securityclick = (sender, e) => {
                 var securityMode = new SecurityMode();
                 UserView.HomePage.Instance.AddChidren(securityMode);
                 UserView.HomePage.Instance.PageIndex += 1;
                 securityMode.Show();
             };
 
-            securityframelayout.MouseUpEventHandler += securityclick;
-            btnsecurity.MouseUpEventHandler += securityclick;
-            btnsecurityback.MouseUpEventHandler += securityclick;
-            securityiconBtn.MouseUpEventHandler += securityclick;
-            securityrow.MouseUpEventHandler += securityclick;
-            #endregion
-
-            #region ----- 宸叉湁鑷姩鍖�------      
-
-            ///宸叉湁鑷姩鍖�
-            var existenceRowLayout = new RowLayout
-            {
-                Height = Application.GetRealHeight(180),
-                //BackgroundColor = 0xff323232,
-                Y = securityframelayout.Bottom,
-            };
-            //middle.AddChidren(existenceRowLayout);
-
-            var existence = new Button
-            {
-                Width = Application.GetRealWidth(400),
-                TextID = MyInternationalizationString.Alreadyautomated,
-                //Text = "宸叉湁鑷姩鍖�",
-                TextSize = 15,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(40),
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-            };
-            existenceRowLayout.AddChidren(existence);
-
-            var btnexistenceback = new Button
-            {
-                Width = Application.GetRealWidth(110),
-                Height = Application.GetRealHeight(110),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                SelectedImagePath = "ZigeeLogic/NextSelecte.png",
-                X = Application.GetRealWidth(1080 - 140),//550
-                Gravity = Gravity.CenterVertical,
-            };
-            existenceRowLayout.AddChidren(btnexistenceback);
-
-            EventHandler<MouseEventArgs> existenceclick = (sender, e) => {
-                var logicListPage = new LogicListPage();
-                UserView.HomePage.Instance.AddChidren(logicListPage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                logicListPage.Show();
-            };
-
-            existenceRowLayout.MouseUpEventHandler += existenceclick;
-            existence.MouseUpEventHandler += existenceclick;
-            btnexistenceback.MouseUpEventHandler += existenceclick;
             #endregion
 
             #region ----- 寤舵椂------
 
-            var delayedframelayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                Y = securityframelayout.Bottom,
-            };
-            middle.AddChidren(delayedframelayout);
-
-            var delayediconBtn = new Button
-            {
-                Width = Application.GetRealWidth(81),
-                Height = Application.GetRealHeight(81),
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-                UnSelectedImagePath = "ZigeeLogic/delay.png",
-
-            };
-            delayedframelayout.AddChidren(delayediconBtn);
-
-            var delayedRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            delayedframelayout.AddChidren(delayedRowLayout);
-
-            var delayed = new Button
-            {
-                TextAlignment = TextAlignment.CenterLeft,
-                TextID = MyInternationalizationString.delayed,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-            };
-            delayedRowLayout.AddChidren(delayed);
-
-            var btndelayedback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = Application.GetRealWidth(789),
-                Gravity = Gravity.CenterVertical,
-            };
-            delayedRowLayout.AddChidren(btndelayedback);
-
-            EventHandler<MouseEventArgs> delayedclick = (sender, e) =>
+            FunView delayedview = new FunView();
+            delayedview.iconBtn.UnSelectedImagePath = "ZigeeLogic/delay.png";
+            delayedview.funnameBtn.TextID = MyInternationalizationString.delayed;
+            delayedview.funFrameLayout.Y = securityview.funFrameLayout.Bottom;
+            delayedview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
+            middle.AddChidren(delayedview.FunFrameView());
+            delayedview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
                 var delayTime = new DelayTime();
                 UserView.HomePage.Instance.AddChidren(delayTime);
                 UserView.HomePage.Instance.PageIndex += 1;
                 delayTime.Show();
             };
-
-            delayedRowLayout.MouseUpEventHandler += delayedclick;
-            delayed.MouseUpEventHandler += delayedclick;
-            btndelayedback.MouseUpEventHandler += delayedclick;
-            delayedframelayout.MouseUpEventHandler += delayedclick;
-            delayediconBtn.MouseUpEventHandler += delayedclick;
+        
             #endregion
         }
 
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddAction.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddAction.cs
index 7ec80cf..fec52b8 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddAction.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddAction.cs
@@ -10,199 +10,55 @@
 
         public AddAction()
         {
-            Tag = "LockLogic";
+            Tag = "Logic";
         }
         public void Show()
         {
-
-
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.addaction,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent();
-            };
+            #region  涓婇潰鐨勫竷灞�浠g爜
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.TextID = MyInternationalizationString.addaction;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             #endregion
-
 
             var middle = new FrameLayout
             {
-                Y = topRowLayout.Bottom,
+                Y =view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
 
-            #region ----- 璁惧------    
-            var deviceframelayout = new FrameLayout
+            #region ----- 璁惧------
+
+            FunView deviceview = new FunView();
+            deviceview.iconBtn.UnSelectedImagePath = "ZigeeLogic/function.png";
+            deviceview.funnameBtn.TextID = MyInternationalizationString.device;
+            middle.AddChidren(deviceview.FunFrameView());
+            deviceview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(deviceframelayout);
-
-            var deviceiconBtn = new Button
-            {
-                Width = Application.GetRealWidth(81),
-                Height = Application.GetRealHeight(81),
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-                UnSelectedImagePath = "ZigeeLogic/function.png",
-
-            };
-            deviceframelayout.AddChidren(deviceiconBtn);
-
-            var devicerow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            deviceframelayout.AddChidren(devicerow);
-
-
-            var btndevice = new Button
-            {
-                TextID = MyInternationalizationString.device,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-            };
-            devicerow.AddChidren(btndevice);
-
-            var btndeviceback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                X = Application.GetRealWidth(789),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-
-            };
-            devicerow.AddChidren(btndeviceback);
-
-            EventHandler<MouseEventArgs> devicestateclick = (sender, e) =>
-            {
-                var lockAddDevice = new LockAddDevice();
-                UserView.HomePage.Instance.AddChidren(lockAddDevice);
+                var roomAndDeviceView = new RoomAndDeviceView();
+                UserView.HomePage.Instance.AddChidren(roomAndDeviceView);
                 UserView.HomePage.Instance.PageIndex += 1;
-                lockAddDevice.Show();
+                roomAndDeviceView.IfType = LogicView.IfString.Action_LockAction;
+                roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.addaction));
             };
-            deviceframelayout.MouseUpEventHandler += devicestateclick;
-            btndevice.MouseUpEventHandler += devicestateclick;
-            btndeviceback.MouseUpEventHandler += devicestateclick;
-            deviceiconBtn.MouseUpEventHandler += devicestateclick;
-            devicerow.MouseUpEventHandler += devicestateclick;
+
             #endregion
 
             #region ----- 鍦烘櫙------
-
-
-            var sceneframelayout = new FrameLayout
+            FunView sceneview = new FunView();
+            sceneview.iconBtn.UnSelectedImagePath = "ZigeeLogic/scene.png";
+            sceneview.funnameBtn.TextID = MyInternationalizationString.scene;
+            sceneview.funFrameLayout.Y = deviceview.funFrameLayout.Bottom;
+            middle.AddChidren(sceneview.FunFrameView());
+            sceneview.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                Y = deviceframelayout.Bottom,
-            };
-            middle.AddChidren(sceneframelayout);
-
-            var sceneiconBtn = new Button
-            {
-                Width = Application.GetRealWidth(81),
-                Height = Application.GetRealHeight(81),
-                X = Application.GetRealWidth(58),
-                Y = Application.GetRealHeight(55),
-                UnSelectedImagePath = "ZigeeLogic/scene.png",
-
-            };
-            sceneframelayout.AddChidren(sceneiconBtn);
-
-
-            var sceneRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(850),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(176),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            sceneframelayout.AddChidren(sceneRowLayout);
-
-            var scene = new Button
-            {
-                TextID = MyInternationalizationString.scene,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 15,
-            };
-            sceneRowLayout.AddChidren(scene);
-
-            var btnsceneback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                X = Application.GetRealWidth(789),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-            };
-            sceneRowLayout.AddChidren(btnsceneback);
-
-            EventHandler<MouseEventArgs> sceneclick = (sender, e) =>
-            {
-                var lockAddScene = new LockAddScene();
-                UserView.HomePage.Instance.AddChidren(lockAddScene);
+                var addScenePage = new AddScenePage();
+                UserView.HomePage.Instance.AddChidren(addScenePage);
                 UserView.HomePage.Instance.PageIndex += 1;
-                lockAddScene.Show();
+                addScenePage.Show(LogicView.IfString.Action_LockScene);
             };
-            sceneRowLayout.MouseUpEventHandler += sceneclick;
-            scene.MouseUpEventHandler += sceneclick;
-            btnsceneback.MouseUpEventHandler += sceneclick;
-            sceneframelayout.MouseUpEventHandler += sceneclick;
-            sceneiconBtn.MouseUpEventHandler += sceneclick;
             #endregion
 
         }
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
index 96425fe..76e071f 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
@@ -9,7 +9,7 @@
     {
         public AddCondition()
         {
-            Tag = "LockLogic";
+            Tag = "Logic";
         }
         Button selectedIcon = new Button();
         VerticalRefreshLayout middle;
@@ -17,62 +17,16 @@
 
         public void Show()
         {
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.userlist,
-                IsBold = true,
-                //Text = "閫夋嫨鐢ㄦ埛",
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
+            
+            #region  涓婇潰鐨勫竷灞�浠g爜
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.TextID = MyInternationalizationString.userlist;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             #endregion
-
             middle = new VerticalRefreshLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
@@ -325,29 +279,6 @@
                     TextSize = 14,
                 };
                 doorlockRow.AddChidren(doorlockBtn);
-                if (string.IsNullOrEmpty(doorlockBtn.Text))
-                {
-                    string strname = "";
-                    switch (userIdmode.OpenMode)
-                    {
-                        case 0:
-                            {
-                                strname = Language.StringByID(MyInternationalizationString.lockpassword);
-                            }
-                            break;
-                        case 3:
-                            {
-                                strname = Language.StringByID(MyInternationalizationString.ic);
-                            }
-                            break;
-                        case 15:
-                            {
-                                strname = Language.StringByID(MyInternationalizationString.fingerprint);
-                            }
-                            break;
-                    }
-                    doorlockBtn.Text = strname + "ID" + userIdmode.UserId;
-                }
 
                 var doorlockSelected = new Button
                 {
@@ -373,12 +304,36 @@
                         //doorlockBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
                         attriButeId = userIdmode.OpenMode.ToString();
                     attriButeData2 = userIdmode.UserId;
-                    modeName = doorlockBtn.Text;
+                    modeName = userIdmode.ModeName;
                 };
                 doorlockRow.MouseUpEventHandler += doorlockclick;
                 doorlockBtn.MouseUpEventHandler += doorlockclick;
                 doorlockSelected.MouseUpEventHandler += doorlockclick;
                 doorlockfra.MouseUpEventHandler += doorlockclick;
+
+                if (string.IsNullOrEmpty(doorlockBtn.Text))
+                {
+                    string strname = "";
+                    switch (userIdmode.OpenMode)
+                    {
+                        case 0:
+                            {
+                                strname = Language.StringByID(MyInternationalizationString.lockpassword);
+                            }
+                            break;
+                        case 3:
+                            {
+                                strname = Language.StringByID(MyInternationalizationString.ic);
+                            }
+                            break;
+                        case 15:
+                            {
+                                strname = Language.StringByID(MyInternationalizationString.fingerprint);
+                            }
+                            break;
+                    }
+                    doorlockBtn.Text = userIdmode.UserId + strname;
+                }
                 ///鏄剧ず涔嬪墠鐨勭姸鎬�
                 if (conditionsIndex != -1)
                 {
@@ -409,8 +364,7 @@
                 lockConditionsInfo.Add("Range", "0");
                 var accounts = new Dictionary<string, string>();
                 accounts.Add("Type", "1");
-                accounts.Add("Account", Config.Instance.Guid);
-                accounts.Add("AccountName", membershipIfon.UserName + modeName);//鐢ㄦ潵鏄剧ず鍚嶇О
+                accounts.Add("Account", membershipIfon.UserName + modeName);
                 accounts.Add("UserId", attriButeData2);
                 if (SelectedLockStatus != "")
                 {
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs
deleted file mode 100644
index 1344c2a..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddDevice.cs
+++ /dev/null
@@ -1,2202 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Newtonsoft.Json.Linq;
-using Shared;
-using Shared.Common;
-using Shared.Phone;
-using Shared.R;
-using ZigBee.Device;
-
-namespace Shared.Phone.Device.Logic.DoorLockLogic
-{
-    public class LockAddDevice:FrameLayout
-    {
-        public LockAddDevice()
-        {
-            Tag = "LockLogic";
-        }
-        Button roombjButton = new Button();
-        Button roomTextButton = new Button();
-        Button devicetypeButton = new Button();
-        VerticalScrolViewLayout middle;
-        FrameLayout clickframeLayout = new FrameLayout();
-        Button clickbutton = new Button();
-        Button clicktextcolcrbutton = new Button();
-        public void Show()
-        {
-
-            UserView.HomePage.Instance.ScrollEnabled = false;
-            this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(160),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.devicestate,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var foolrname = new Button
-            {
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterRight,
-                X = Application.GetRealWidth(1080 - 400 - 120),
-                Width = Application.GetRealWidth(400),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                //TextID = MyInternationalizationString.customroom,
-                Text = Config.Instance.Home.GetCurrentFloorName,
-                TextSize = 14,
-            };
-            topRowLayout.AddChidren(foolrname);
-            var dropdown = new Button
-            {
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterRight,
-                X = foolrname.Right,
-                Width = Application.GetRealWidth(72),
-                Height = Application.GetRealHeight(72),
-                Y = Application.GetRealHeight(92),
-                UnSelectedImagePath = "ZigeeLogic/drop-down.png",
-            };
-            topRowLayout.AddChidren(dropdown);
-            #endregion
-
-
-            ///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱
-            if (Common.Room.Lists.Count == 0)
-            {
-                return;
-            }
-            ///鎴块棿婊戝姩鎺т欢
-            var roomhorizontalScrol = new HorizontalScrolViewLayout()
-            {
-                Width = Application.GetRealWidth(1080 - 58),
-                Height = Application.GetRealHeight(200),
-                Y = topRowLayout.Bottom,
-                X = Application.GetRealWidth(58),
-            };
-            this.AddChidren(roomhorizontalScrol);
-
-
-       
-            ///璁惧绫诲瀷婊戝姩鎺т欢
-            var devicetypehorizontalScrol = new HorizontalScrolViewLayout()
-            {
-                Width = Application.GetRealWidth(1080 - 58),
-                Height = Application.GetRealHeight(280),
-                Y = roomhorizontalScrol.Bottom,
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                X = Application.GetRealWidth(58),
-               // Radius = (uint)Application.GetRealHeight(50),
-
-            };
-            this.AddChidren(devicetypehorizontalScrol);
-            devicetypehorizontalScrol.SetCornerWithSameRadius(Application.GetRealHeight(58),HDLUtils.RectCornerBottomLeft);
-
-            middle = new VerticalScrolViewLayout();
-            middle.Y = devicetypehorizontalScrol.Bottom + Application.GetRealHeight(40);
-            middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-            middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
-            middle.X = Application.GetRealWidth(58);
-            //middle.Radius = (uint)Application.GetRealHeight(50);
-            this.AddChidren(middle);
-            middle.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
-
-            ///鐩墠鏀寔鐨勮澶�
-            List<DeviceType> deviceTypeList = new List<DeviceType> {
-                DeviceType.OnOffOutput,
-                DeviceType.DimmableLight,
-                DeviceType.WindowCoveringDevice,
-                DeviceType.Thermostat,
-                DeviceType.AirSwitch,
-            };
-
-
-
-            ///妤煎眰鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> foorlclick = (sender, e) =>
-            {
-
-                var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                this.AddChidren(flMain);
-                flMain.MouseUpEventHandler += (sender2, e2) =>
-                {
-                    flMain.RemoveFromParent();
-                };
-                var foolrbjicon = new FrameLayout
-                {
-
-                    Width = Application.GetRealWidth(450),
-                    Height = Application.GetRealHeight(780),
-                    X = Application.GetRealWidth(1080 - 468 - 35),
-                    Y = Application.GetRealHeight(184),
-                    BackgroundImagePath = "Item/SelectFloor_Right.png",
-                };
-                flMain.AddChidren(foolrbjicon);
-
-                var btnfoolrtext = new Button
-                {
-                    Width = Application.GetRealWidth(450),
-                    Height = Application.GetRealHeight(150),
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    X = Application.GetRealWidth(80),
-                    TextID = MyInternationalizationString.selecfoolr,
-                    TextSize = 14,
-                };
-                foolrbjicon.AddChidren(btnfoolrtext);
-
-                var foolrbj = new VerticalScrolViewLayout
-                {
-
-                    Width = Application.GetRealWidth(450),
-                    Height = foolrbjicon.Height - btnfoolrtext.Height,
-                    X = Application.GetRealWidth(80),
-                    Y = btnfoolrtext.Bottom,
-                };
-                foolrbjicon.AddChidren(foolrbj);
-
-                foreach (var foolr in Config.Instance.Home.FloorDics)
-                {
-                    var foolrRowLayout = new RowLayout
-                    {
-                        Height = Application.GetRealHeight(150),
-                        LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-                    };
-                    foolrbj.AddChidren(foolrRowLayout);
-
-                    var btnfoolricon = new Button
-                    {
-                        Width = Application.GetRealWidth(81),
-                        Height = Application.GetRealHeight(81),
-                        UnSelectedImagePath = "Floor/Floor.png",
-                        Gravity = Gravity.CenterVertical,
-                    };
-                    foolrRowLayout.AddChidren(btnfoolricon);
-
-
-                    var btnfoolrname = new Button
-                    {
-                        Width = Application.GetRealWidth(250),
-                        Height = Application.GetRealHeight(150),
-                        Text = foolr.Value,
-                        TextAlignment = TextAlignment.CenterLeft,
-                        TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                        Tag = foolr.Key,
-                        X = btnfoolricon.Right + Application.GetRealWidth(12),
-                        TextSize = 14,
-                    };
-                    foolrRowLayout.AddChidren(btnfoolrname);
-                    if (foolrname.Text == foolr.Value)
-                    {
-                        btnfoolricon.UnSelectedImagePath = "Floor/FloorSelected.png";
-                        btnfoolrname.TextColor = ZigbeeColor.Current.LogicTextBlackColor;
-                    }
-
-                    EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) =>
-                    {
-                        roomhorizontalScrol.RemoveAll();
-                        devicetypehorizontalScrol.RemoveAll();
-                        middle.RemoveAll();
-                        foolrname.Text = btnfoolrname.Text;
-                        flMain.RemoveFromParent();
-                        var list = Send.GetRoomList(btnfoolrname.Tag.ToString());
-                        AllRoomView(list, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
-
-                    };
-                    foolrRowLayout.MouseUpEventHandler += foolrnameclick;
-                    btnfoolrname.MouseUpEventHandler += foolrnameclick;
-
-
-                }
-
-            };
-            foolrname.MouseUpEventHandler += foorlclick;
-            dropdown.MouseUpEventHandler += foorlclick;
-            ///绗竴娆¤繘鏉�
-            var roomlists = new List<Common.Room>();
-            roomlists.Clear();
-            if (Config.Instance.Home.FloorDics.Count < 2)
-            {
-                foolrname.Visible = false;
-                dropdown.Visible = false;
-                if (Config.Instance.Home.FloorDics.Count == 0)
-                {
-                    roomlists.AddRange(Common.Room.Lists);
-                }
-                else
-                {
-                    roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
-                }
-            }
-            else
-            {
-                roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
-
-            }
-
-
-            AllRoomView(roomlists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
-
-
-        }
-        /// <summary>
-        /// 鍔犺浇鎵�鏈夋埧闂寸殑瑙嗗浘鏂规硶
-        /// </summary>
-        void AllRoomView(List<Common.Room> roomlist, List<DeviceType> deviceTypeList, HorizontalScrolViewLayout roomhorizontalScrol, HorizontalScrolViewLayout devicetypehorizontalScrol)
-        {
-            for (int i = 0; i < roomlist.Count; i++)
-            {
-                var room = roomlist[i];
-                var fra = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(200),
-                    Width = Application.GetRealWidth(255),
-                };
-                roomhorizontalScrol.AddChidren(fra);
-
-                var roombjBtn = new Button
-                {
-                    Height = Application.GetRealHeight(158),
-                    Width = Application.GetRealWidth(255),
-                    UnSelectedImagePath = "ZigeeLogic/iconBackgroundColor.png",
-                    SelectedImagePath = "ZigeeLogic/iconSelectedBackgroundColor.png",
-                    Y = Application.GetRealHeight(21),
-                };
-                fra.AddChidren(roombjBtn);
-
-                var roomnameBtn = new Button
-                {
-
-                    Height = Application.GetRealHeight(152 - 26 - 20),
-                    Width = Application.GetRealWidth(255 - 20 - 50),
-                    Text = room.Name,
-                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                    SelectedTextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    Y = Application.GetRealHeight(21 + 13 + 10),
-                    X = Application.GetRealWidth(10 + 25),
-
-                };
-                fra.AddChidren(roomnameBtn);
-                if (i == 0)
-                {
-                    roombjButton.IsSelected = false;
-                    roombjButton = roombjBtn;
-                    roombjBtn.IsSelected = true;
-
-                    roomTextButton.IsSelected = false;
-                    roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
-                    var list = new List<DeviceUI>();
-                    foreach (var device in room.DeviceUIList)
-                    {
-                        if (device.CommonDevice == null)
-                        {
-                            continue;
-                        }
-                        if (!deviceTypeList.Contains(device.CommonDevice.Type))
-                        {
-                            continue;
-                        }
-                        list.Add(device);
-                    }
-                    if (list.Count == 0)
-                    {
-                        devicetypehorizontalScrol.Height = 0;
-                        
-                        middle.Height = 0;
-                    }
-                    else
-                    {
-                        devicetypehorizontalScrol.Height = Application.GetRealHeight(280);
-                       
-                        middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-                    }
-                    AllDeviceTypeView(list, devicetypehorizontalScrol);
-
-                }
-
-
-                EventHandler<MouseEventArgs> roomclick = (sender, e) =>
-                {
-                    roombjButton.IsSelected = false;
-                    roombjButton = roombjBtn;
-                    roombjBtn.IsSelected = true;
-
-                    roomTextButton.IsSelected = false;
-                    roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
-                    var list = new List<DeviceUI>();
-                    foreach (var device in room.DeviceUIList)
-                    {
-                        if (device.CommonDevice == null)
-                        {
-                            continue;
-                        }
-                        if (!deviceTypeList.Contains(device.CommonDevice.Type))
-                        {
-                            continue;
-                        }
-                        list.Add(device);
-                    }
-                    if (list.Count == 0)
-                    {
-                        devicetypehorizontalScrol.Height = 0;
-                       
-                        middle.Height = 0;
-                    }
-                    else
-                    {
-                        devicetypehorizontalScrol.Height = Application.GetRealHeight(280);
-                       
-                        middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-                    }
-                    AllDeviceTypeView(list, devicetypehorizontalScrol);
-
-
-                };
-                roomnameBtn.MouseUpEventHandler += roomclick;
-                roombjBtn.MouseUpEventHandler += roomclick;
-
-            }
-        }
-
-        /// <summary>
-        ///鍔犺浇璇ュ尯鍩熸墍鏈夎澶囩殑瑙嗗浘鏂规硶
-        /// </summary>
-        void AllDeviceTypeView(List<DeviceUI> devicelist, HorizontalScrolViewLayout devicetypehorizontalScrol)
-        {
-
-            List<string> devicetypelist = new List<string>();
-            devicetypelist.Clear();
-
-            #region  ------鎺掑垪璁惧绫诲瀷------
-            var lightjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.DimmableLight || device.CommonDevice.Type == DeviceType.OnOffOutput);
-            if (lightjosn != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Lights));
-            }
-            var curtainjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.WindowCoveringDevice);
-            if (curtainjosn != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains));
-            }
-            var ac = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.Thermostat);
-            if (ac != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.AC));
-            }
-            var airSwitch = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.AirSwitch);
-            if (airSwitch != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Airswitch));
-            }
-
-            #endregion
-
-            devicetypehorizontalScrol.RemoveAll();
-            for (int i = 0; i < devicetypelist.Count; i++)
-            {
-
-                var devicetype = devicetypelist[i];
-
-                var spaceRowLayout = new FrameLayout();
-                devicetypehorizontalScrol.AddChidren(spaceRowLayout);
-                if (i == 0)
-                {
-                    spaceRowLayout.Width = Application.GetRealWidth(37);
-                }
-                else
-                {
-                    spaceRowLayout.Width = Application.GetRealWidth(80);
-                }
-
-                var deviceRowLayout = new FrameLayout
-                {
-                    Width = Application.GetRealWidth(156 + 20),
-                    Height = Application.GetRealHeight(280 - 30),
-                    Y = Application.GetRealHeight(30),
-                };
-                devicetypehorizontalScrol.AddChidren(deviceRowLayout);
-
-                var backgroundColor = new Button
-                {
-                    Width = Application.GetRealWidth(156),
-                    Height = Application.GetRealHeight(180),
-                    X = Application.GetRealWidth(10),
-                    UnSelectedImagePath = "ZigeeLogic/deviceunselectedbackgroundcolor.png",
-                    SelectedImagePath = "ZigeeLogic/deviceselectedbackgroundcolor.png",
-                };
-                deviceRowLayout.AddChidren(backgroundColor);
-
-
-                var devicetypeicon = new Button
-                {
-                    Width = Application.GetRealWidth(84),
-                    Height = Application.GetRealHeight(84),
-                    X = Application.GetRealWidth(46),
-                    Y = Application.GetRealHeight(30),
-                };
-                deviceRowLayout.AddChidren(devicetypeicon);
-
-                var devicetypename = new Button
-                {
-                    Width = Application.GetRealWidth(176),
-                    Height = Application.GetRealHeight(40),
-                    Text = devicetype,
-                    TextAlignment = TextAlignment.Center,
-                    Y = backgroundColor.Bottom,
-                    TextColor = ZigbeeColor.Current.LogicAddColor,
-                    TextSize = 10,
-                };
-                deviceRowLayout.AddChidren(devicetypename);
-                if (devicetype == Language.StringByID(MyInternationalizationString.Lights))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedlight.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.Curtains))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedcurtain.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.AC))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedac.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.Airswitch))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedairswitch.png";
-                }
-                EventHandler<MouseEventArgs> devicetypeclick = (sender13, e13) =>
-                {
-
-                    devicetypeButton.IsSelected = false;
-                    devicetypeButton = backgroundColor;
-                    backgroundColor.IsSelected = true;
-                    List<DeviceType> list = new List<DeviceType>();
-                    list.Clear();
-                    ///鍒嗙被鏄剧ず锛堜緥濡傜伅鍏夛細{鐏厜1锛岀伅鍏�2...}锛�
-                    if (devicetype == Language.StringByID(MyInternationalizationString.Lights))
-                    {
-                        list.Add(DeviceType.OnOffOutput);//0x0101鍗佽繘鍒�257
-                        list.Add(DeviceType.DimmableLight);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.Curtains))
-                    {
-                        list.Add(DeviceType.WindowCoveringDevice);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.AC))
-                    {
-                        list.Add(DeviceType.Thermostat);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.Airswitch))
-                    {
-                        list.Add(DeviceType.AirSwitch);
-                    }
-
-                    ActionDeviceView(list, devicelist);
-
-                };
-                deviceRowLayout.MouseUpEventHandler += devicetypeclick;
-                devicetypename.MouseUpEventHandler += devicetypeclick;
-                devicetypeicon.MouseUpEventHandler += devicetypeclick;
-                backgroundColor.MouseUpEventHandler += devicetypeclick;
-
-            }
-            ///鏄剧ず鎴块棿鎵�鏈夎澶�
-            ActionDeviceView(new List<DeviceType>(), devicelist);
-        }
-        /// <summary>
-        /// 鍔犺浇璇ョ被鍨嬭澶囪鍥炬柟娉�
-        /// </summary>
-        /// <param name="devicelist">璁惧鍒楄〃</param>
-        void ActionDeviceView(List<DeviceType> deviceTypelist, List<DeviceUI> devicelist)
-        {
-            middle.RemoveAll();
-            foreach (var common in devicelist)
-            {
-
-                if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.CommonDevice.Type))
-                {
-                    continue;
-                }
-
-                var deviceFramelayout = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(160),
-                };
-                middle.AddChidren(deviceFramelayout);
-
-                var bjFramelayout = new FrameLayout
-                {
-                    Width = Application.GetRealWidth(112),
-                    Height = Application.GetRealHeight(112),
-                    X = Application.GetRealWidth(58),
-                    Y = Application.GetRealHeight(30 + 9),
-                    Radius = (uint)Application.GetRealHeight(56),
-                    BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-                };
-                deviceFramelayout.AddChidren(bjFramelayout);
-
-                var deviceIconBtn = new Button
-                {
-                    Width = Application.GetRealWidth(82),
-                    Height = Application.GetRealHeight(82),
-                    Gravity = Gravity.Center,
-
-                };
-                bjFramelayout.AddChidren(deviceIconBtn);
-
-                var deviceRow = new RowLayout
-                {
-                    Y = Application.GetRealHeight(30),
-                    Width = Application.GetRealWidth(850),
-                    Height = Application.GetRealHeight(130),
-                    X = Application.GetRealWidth(176 + 10),
-                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-
-                };
-                deviceFramelayout.AddChidren(deviceRow);
-
-                var devicename = new Button
-                {
-                    Text = common.CommonDevice.DeviceEpointName,
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    SelectedTextColor = ZigbeeColor.Current.LogicAddColor,
-                    TextSize = 14,
-                };
-                deviceRow.AddChidren(devicename);
-                switch (common.CommonDevice.Type)
-                {
-
-                    case DeviceType.OnOffOutput:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/light.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedlight.png";
-                        }
-                        break;
-                    case DeviceType.DimmableLight:
-                        {
-
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/dimmableLight.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selecteddimmableLight.png";
-                        }
-                        break;
-                    case DeviceType.WindowCoveringDevice:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/curtain.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedcurtain.png";
-                        }
-                        break;
-                    case DeviceType.Thermostat:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/ac.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedac.png";
-                        }
-                        break;
-                    case DeviceType.AirSwitch:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/airswitch.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedairswitch.png";
-                        }
-                        break;
-                }
-
-                EventHandler<MouseEventArgs> devicclick = (sen, e) =>
-                {
-                    clickbutton.IsSelected = false;
-                    clickbutton = deviceIconBtn;
-                    deviceIconBtn.IsSelected = true;
-                    clickframeLayout.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-                    clickframeLayout = bjFramelayout;
-                    bjFramelayout.BackgroundColor = ZigbeeColor.Current.LogicIconBackgroundColor;
-                    clicktextcolcrbutton.IsSelected = false;
-                    clicktextcolcrbutton = devicename;
-                    devicename.IsSelected = true;
-
-                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                    this.AddChidren(flMain);
-                    CurrentDeviceStateView(flMain, common.CommonDevice, false);
-                };
-                deviceFramelayout.MouseUpEventHandler += devicclick;
-                bjFramelayout.MouseUpEventHandler += devicclick;
-                deviceIconBtn.MouseUpEventHandler += devicclick;
-                deviceRow.MouseUpEventHandler += devicclick;
-                devicename.MouseUpEventHandler += devicclick;
-
-            }
-        }
-        /// <summary>
-        /// 閫変腑璇ヨ澶囧姛鑳戒綔涓烘潯浠剁殑瑙嗗浘鏂规硶
-        /// </summary>
-        /// <param name="common">Common.</param>
-        public static void CurrentDeviceStateView(FrameLayout flMain, CommonDevice common, bool edit)
-        {
-            //涓嶈褰撳墠鐣岄潰婊戝姩
-            UserView.HomePage.Instance.ScrollEnabled = false;
-            Dictionary<string, object> actionsInfo = new Dictionary<string, object>();
-            List<Dictionary<string, string>> taskListInfo = new List<Dictionary<string, string>>();
-            flMain.MouseUpEventHandler += (sender, e) =>
-            {
-                flMain.RemoveFromParent();
-            };
-        
-
-            var devicefra = new FrameLayout
-            {
-
-                Width = Application.GetRealWidth(1080),
-                Height = Application.GetRealHeight(530 + 160),
-                Y = Application.GetRealHeight(1920 - 530 - 160),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                Radius = (uint)Application.GetRealHeight(60),
-            };
-            flMain.AddChidren(devicefra);
-            devicefra.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
-
-            #region  -------鍙栨秷   瀹屾垚
-            var timetype = new RowLayout
-            {
-                Height = Application.GetRealHeight(140),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            devicefra.AddChidren(timetype);
-            var Btncancel = new Button
-            {
-                TextID = MyInternationalizationString.cancel,
-                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                X = Application.GetRealWidth(80),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextSize = 14,
-            };
-            timetype.AddChidren(Btncancel);
-            Btncancel.MouseUpEventHandler += (sender16, e16) =>
-            {
-                flMain.RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var Btntitle = new Button
-            {
-                TextID = MyInternationalizationString.security,
-                TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(420),
-                TextAlignment = TextAlignment.Center,
-                X = Btncancel.Right + Application.GetRealWidth(50),
-                TextSize = 16,
-                Text = common.DeviceEpointName,
-            };
-            timetype.AddChidren(Btntitle);
-            var Btncomplete = new Button
-            {
-                TextID = MyInternationalizationString.complete,
-                TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                TextAlignment = TextAlignment.CenterRight,
-                X = Btntitle.Right + Application.GetRealWidth(50),
-                TextSize = 14,
-
-            };
-            timetype.AddChidren(Btncomplete);
-            #endregion
-
-            string SelectedDeviceStatusaction = "no";
-            actionsInfo.Add("LinkType", 0);
-            actionsInfo.Add("DeviceAddr", common.DeviceAddr);
-            actionsInfo.Add("Epoint", common.DeviceEpoint);
-            actionsInfo.Add("Time", 0);
-            actionsInfo.Add("TaskList", taskListInfo);
-
-            List<Dictionary<string, string>> TaskList = null;
-            if (edit)
-            {
-                foreach (var deviceinfo in Common.Logic.CurrentLogic.Actions)
-                {
-                    if (deviceinfo["LinkType"].ToString() == "0")
-                    {
-
-                        if (deviceinfo["DeviceAddr"].ToString() == common.DeviceAddr && deviceinfo["Epoint"].ToString() == common.DeviceEpoint.ToString())
-                        {
-                            TaskList = deviceinfo["TaskList"] as List<Dictionary<string, string>>;
-                            break;
-                        }
-                    }
-                }
-            }
-            switch (common.Type)
-            {
-
-                ///鐏厜
-                case DeviceType.OnOffOutput:
-                    {
-
-                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                        Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
-                        if (switchdictionary.ContainsKey("TaskType"))
-                        {
-                            switchdictionary.Remove("TaskType");
-                        }
-                        if (switchdictionary.ContainsKey("Data1"))
-                        {
-                            switchdictionary.Remove("Data1");
-                        }
-                        if (switchdictionary.ContainsKey("Data2"))
-                        {
-                            switchdictionary.Remove("Data2");
-                        }
-                        switchdictionary.Add("TaskType", "1");
-                        switchdictionary.Add("Data1", "0");
-                        switchdictionary.Add("Data2", "0");
-                        taskListInfo.Add(switchdictionary);
-
-                        #endregion
-
-                        #region  鐏厜View
-
-                        #region 寮�
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-                        #endregion
-                        #region  鍏�
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = openframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-                        #endregion
-                        #region   鍙栧弽
-                        var takebackframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = closeframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(takebackframelayout);
-                        var takebackrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        takebackframelayout.AddChidren(takebackrowlayout);
-
-                        var btntakeback = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.onoff,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        takebackrowlayout.AddChidren(btntakeback);
-
-                        var takebackBtnSelected = new SelectedButton();
-                        takebackrowlayout.AddChidren(takebackBtnSelected);
-
-                        #endregion
-
-
-                        #endregion
-
-                        ///纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            takebackBtnSelected.Visible = false;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("Data1", "1");//榛樿鍊�
-
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-                        ///鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-                            takebackBtnSelected.Visible = false;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("Data1", "0");//榛樿鍊�
-
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-                        //鍙栧弽
-                        EventHandler<MouseEventArgs> takebackclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = false;
-                            takebackBtnSelected.Visible = true;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("Data1", "2");//榛樿鍊�
-
-                        };
-                        takebackrowlayout.MouseUpEventHandler += takebackclick;
-                        btntakeback.MouseUpEventHandler += takebackclick;
-                        takebackBtnSelected.MouseUpEventHandler += takebackclick;
-                        takebackframelayout.MouseUpEventHandler += takebackclick;
-                        if (edit && TaskList != null)
-                        {
-                            foreach (var value in TaskList)
-                            {
-                                if (value["TaskType"] == "1")
-                                {
-                                    if (switchdictionary.ContainsKey("Data1"))
-                                    {
-                                        switchdictionary.Remove("Data1");
-                                    }
-                                    if (value["Data1"] == "1")
-                                    {
-                                        switchdictionary.Add("Data1", "1");
-                                        openBtnSelected.Visible = true;
-                                        closeBtnSelected.Visible = false;
-                                        takebackBtnSelected.Visible = false;
-                                    }
-                                    else if (value["Data1"] == "0")
-                                    {
-                                        switchdictionary.Add("Data1", "0");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = true;
-                                        takebackBtnSelected.Visible = false;
-                                    }
-                                    else if (value["Data1"] == "2")
-                                    {
-                                        switchdictionary.Add("Data1", "2");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = false;
-                                        takebackBtnSelected.Visible = true;
-                                    }
-                                    break;
-                                }
-
-                            }
-                        }
-
-                    }
-                    break;
-                ///璋冨厜鐏厜
-                case DeviceType.DimmableLight:
-                    {
-
-                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                        Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
-                        if (switchdictionary.ContainsKey("Data2"))
-                        {
-                            switchdictionary.Remove("Data2");
-                        }
-                        switchdictionary.Add("Data2", "0");
-                        taskListInfo.Add(switchdictionary);
-
-                        #endregion
-
-                        #region  鐏厜View
-
-                        devicefra.Y = Application.GetRealHeight(1920 - 160 * 3 - 210 - 160);
-                        devicefra.Height = Application.GetRealHeight(160 * 3 + 210 + 160);
-
-                        #region 寮�
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160 + 160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-
-                        var horizontalSeekBarRow = new RowLayout
-                        {
-                            Y = openrowlayout.Bottom,
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(160),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(horizontalSeekBarRow);
-                        var horizontalSeekBarVol = new DiyImageSeekBar
-                        {
-                            Y = openrowlayout.Bottom,
-                            X = Application.GetRealWidth(80),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(160),
-                            IsProgressTextShow = true,//鏄剧ず鐧惧垎姣�
-                            IsClickable = false,//杩涘害鏉℃槸鍚︽粦鍔�
-                            ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//閫変腑杩涘害鏉¢鑹�
-                            ThumbImagePath = "ZigeeLogic/progressbtn2.png",//杩涘害鏉℃寜閽浘鏍�
-                            ThumbImageHeight = Application.GetRealHeight(56),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
-                            ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,//杩涘害鏉″師棰滆壊
-                            ProgressTextSize = 12,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏� 
-                            SeekBarViewHeight = Application.GetRealHeight(10),//杩涘害鏉$殑楂樺害
-                        };
-                        openframelayout.AddChidren(horizontalSeekBarVol);
-
-                        #endregion
-
-                        #region  鍏�
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = openframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-                        #endregion
-
-                        #region   鍙栧弽
-                        var takebackframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = closeframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(takebackframelayout);
-                        var takebackrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        takebackframelayout.AddChidren(takebackrowlayout);
-
-                        var btntakeback = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.onoff,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        takebackrowlayout.AddChidren(btntakeback);
-
-                        var takebackBtnSelected = new SelectedButton();
-                        takebackrowlayout.AddChidren(takebackBtnSelected);
-
-                        #endregion
-
-
-                        #endregion
-
-                        int Progressvalue = 100;
-                        EventHandler<int> progressclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            Progressvalue = horizontalSeekBarVol.Progress;
-                            if (switchdictionary.ContainsKey("TaskType"))
-                            {
-                                switchdictionary.Remove("TaskType");
-                            }
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("TaskType", "3");
-                            //鏈�澶т寒搴﹀�兼槸254闇�瑕佽浆鎹紱
-                            var lightbrightnessvalue = (254 * horizontalSeekBarVol.Progress) / 100;
-                            switchdictionary.Add("Data1", lightbrightnessvalue.ToString());
-
-                        };
-                        horizontalSeekBarVol.OnProgressChangedEvent += progressclick;
-                        horizontalSeekBarVol.OnStopTrackingTouchEvent += progressclick;
-                        ///纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsClickable = true;
-                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected;
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            takebackBtnSelected.Visible = false;
-                            horizontalSeekBarVol.Progress = Progressvalue;
-                            if (switchdictionary.ContainsKey("TaskType"))
-                            {
-                                switchdictionary.Remove("TaskType");
-                            }
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("TaskType", "3");
-                            //鏈�澶т寒搴﹀�兼槸254闇�瑕佽浆鎹紱
-                            var lightbrightnessvalue = (254 * horizontalSeekBarVol.Progress) / 100;
-                            switchdictionary.Add("Data1", lightbrightnessvalue.ToString());
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-                        ///鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsClickable = false;
-                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-                            takebackBtnSelected.Visible = false;
-                            if (switchdictionary.ContainsKey("TaskType"))
-                            {
-                                switchdictionary.Remove("TaskType");
-                            }
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("TaskType", "1");
-                            switchdictionary.Add("Data1", "0");//榛樿鍊�
-
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-                        //鍙栧弽
-                        EventHandler<MouseEventArgs> takebackclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsClickable = false;
-                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = false;
-                            takebackBtnSelected.Visible = true;
-                            if (switchdictionary.ContainsKey("TaskType"))
-                            {
-                                switchdictionary.Remove("TaskType");
-                            }
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("TaskType", "1");
-                            switchdictionary.Add("Data1", "2");//榛樿鍊�
-
-                        };
-                        takebackrowlayout.MouseUpEventHandler += takebackclick;
-                        btntakeback.MouseUpEventHandler += takebackclick;
-                        takebackBtnSelected.MouseUpEventHandler += takebackclick;
-                        takebackframelayout.MouseUpEventHandler += takebackclick;
-
-                        if (edit && TaskList != null)
-                        {
-                            foreach (var value in TaskList)
-                            {
-                                if (switchdictionary.ContainsKey("Data1"))
-                                {
-                                    switchdictionary.Remove("Data1");
-                                }
-                                if (switchdictionary.ContainsKey("TaskType"))
-                                {
-                                    switchdictionary.Remove("TaskType");
-                                }
-                                if (value["TaskType"] == "1")
-                                {
-                                    switchdictionary.Add("TaskType", "1");
-                                    if (value["Data1"] == "0")
-                                    {
-                                        switchdictionary.Add("Data1", "0");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = true;
-                                        takebackBtnSelected.Visible = false;
-                                        horizontalSeekBarVol.IsClickable = false;
-                                        horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
-                                    }
-                                    else if (value["Data1"] == "2")
-                                    {
-                                        switchdictionary.Add("Data1", "2");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = false;
-                                        takebackBtnSelected.Visible = true;
-                                        horizontalSeekBarVol.IsClickable = false;
-                                        horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
-                                    }
-
-                                }
-                                else if (value["TaskType"] == "3")
-                                {
-                                    switchdictionary.Add("TaskType", "3");
-                                    switchdictionary.Add("Data1", value["Data1"]);
-                                    openBtnSelected.Visible = true;
-                                    closeBtnSelected.Visible = false;
-                                    takebackBtnSelected.Visible = false;
-                                    horizontalSeekBarVol.IsClickable = true;
-                                    horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected;
-                                    horizontalSeekBarVol.Progress = int.Parse(value["Data1"]) * 100 / 254;
-                                    Progressvalue = horizontalSeekBarVol.Progress;
-
-                                }
-                                break;
-
-                            }
-                        }
-
-                    }
-                    break;
-                ///绐楀笜
-                case DeviceType.WindowCoveringDevice:
-                    {
-                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                        Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
-                        if (switchdictionary.ContainsKey("TaskType"))
-                        {
-                            switchdictionary.Remove("TaskType");
-                        }
-                        switchdictionary.Add("TaskType", "6");
-
-                        taskListInfo.Add(switchdictionary);
-
-                        #endregion
-                        devicefra.Y = Application.GetRealHeight(1920 - 160 * 2 - 210 - 160);
-                        devicefra.Height = Application.GetRealHeight(160 * 2 + 210 + 160);
-                        #region 绐楀笜View
-
-                        #region 寮�
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160 + 160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-
-
-                        var horizontalSeekBarRow = new RowLayout
-                        {
-                            Y = openrowlayout.Bottom,
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(160),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(horizontalSeekBarRow);
-                        var horizontalSeekBarVol = new DiyImageSeekBar
-                        {
-                            Y = openrowlayout.Bottom,
-                            X = Application.GetRealWidth(80),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(160),
-                            IsProgressTextShow = true,//鏄剧ず鐧惧垎姣�
-                            IsClickable = false,//杩涘害鏉℃槸鍚︽粦鍔�
-                            ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//閫変腑杩涘害鏉¢鑹�
-                            ThumbImagePath = "ZigeeLogic/progressbtn2.png",//杩涘害鏉℃寜閽浘鏍�
-                            ThumbImageHeight = Application.GetRealHeight(56),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
-                            ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,//杩涘害鏉″師棰滆壊
-                            ProgressTextSize = 12,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏� 
-                            SeekBarViewHeight = Application.GetRealHeight(10),//杩涘害鏉$殑楂樺害
-                        };
-                        openframelayout.AddChidren(horizontalSeekBarVol);
-
-                        #endregion
-
-                        #region  鍏�
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = openframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-                        #endregion
-
-
-
-                        #endregion
-                        int Progressvalue = 100;
-                        EventHandler<int> progressclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            Progressvalue = horizontalSeekBarVol.Progress;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            if (switchdictionary.ContainsKey("Data2"))
-                            {
-                                switchdictionary.Remove("Data2");
-                            }
-                            switchdictionary.Add("Data1", "5");
-                            switchdictionary.Add("Data2", horizontalSeekBarVol.Progress.ToString());
-
-                        };
-                        horizontalSeekBarVol.OnProgressChangedEvent += progressclick;
-                        horizontalSeekBarVol.OnStopTrackingTouchEvent += progressclick;
-                        ///纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsClickable = true;
-                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected;
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            horizontalSeekBarVol.Progress = Progressvalue;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            if (switchdictionary.ContainsKey("Data2"))
-                            {
-                                switchdictionary.Remove("Data2");
-                            }
-                            switchdictionary.Add("Data1", "5");
-                            switchdictionary.Add("Data2", horizontalSeekBarVol.Progress.ToString());
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-                        ///鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsClickable = false;
-                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            if (switchdictionary.ContainsKey("Data2"))
-                            {
-                                switchdictionary.Remove("Data2");
-                            }
-                            switchdictionary.Add("Data2", "0");
-                            switchdictionary.Add("Data1", "1");//榛樿鍊�
-
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-
-
-
-                        if (edit && TaskList != null)
-                        {
-                            foreach (var value in TaskList)
-                            {
-                                if (value["TaskType"] == "6")
-                                {
-                                    if (value["Data1"] == "5")
-                                    {
-                                        if (switchdictionary.ContainsKey("Data1"))
-                                        {
-                                            switchdictionary.Remove("Data1");
-                                        }
-                                        if (switchdictionary.ContainsKey("Data2"))
-                                        {
-                                            switchdictionary.Remove("Data2");
-                                        }
-                                        switchdictionary.Add("Data1", "5");
-                                        switchdictionary.Add("Data2", value["Data2"]);
-                                        horizontalSeekBarVol.IsClickable = true;
-                                        horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected;
-                                        openBtnSelected.Visible = true;
-                                        closeBtnSelected.Visible = false;
-                                        horizontalSeekBarVol.Progress = int.Parse(value["Data2"]);
-                                        Progressvalue = horizontalSeekBarVol.Progress;
-                                    }
-                                    else if (value["Data1"] == "1")
-                                    {
-                                        if (switchdictionary.ContainsKey("Data1"))
-                                        {
-                                            switchdictionary.Remove("Data1");
-                                        }
-                                        switchdictionary.Add("Data1", "1");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = true;
-                                        horizontalSeekBarVol.IsClickable = false;
-                                        horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
-                                    }
-
-                                }
-
-                            }
-                        }
-                    }
-                    break;
-                ///绌烘皵寮�鍏�
-                case DeviceType.AirSwitch:
-                    {
-                        {
-
-                            #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                            Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
-                            if (switchdictionary.ContainsKey("TaskType"))
-                            {
-                                switchdictionary.Remove("TaskType");
-                            }
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            if (switchdictionary.ContainsKey("Data2"))
-                            {
-                                switchdictionary.Remove("Data2");
-                            }
-                            switchdictionary.Add("TaskType", "1");
-                            switchdictionary.Add("Data1", "0");
-                            switchdictionary.Add("Data2", "0");
-                            taskListInfo.Add(switchdictionary);
-
-                            #endregion
-
-                            #region  绌烘皵鐏厜View
-
-                            #region 寮�
-
-                            var openframelayout = new FrameLayout
-                            {
-                                Height = Application.GetRealHeight(160),
-                                Y = timetype.Bottom + Application.GetRealHeight(20),
-                            };
-                            devicefra.AddChidren(openframelayout);
-
-                            var openrowlayout = new RowLayout
-                            {
-                                Y = Application.GetRealHeight(30),
-                                Width = Application.GetRealWidth(920),
-                                Height = Application.GetRealHeight(130),
-                                X = Application.GetRealWidth(80),
-                                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                            };
-                            openframelayout.AddChidren(openrowlayout);
-
-                            var btnopen = new Button
-                            {
-                                Width = Application.GetRealWidth(600),
-                                TextID = MyInternationalizationString.open,
-                                TextAlignment = TextAlignment.CenterLeft,
-                                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                                TextSize = 14,
-                            };
-                            openrowlayout.AddChidren(btnopen);
-
-                            var openBtnSelected = new SelectedButton();
-                            openrowlayout.AddChidren(openBtnSelected);
-                            #endregion
-                            #region  鍏�
-                            var closeframelayout = new FrameLayout
-                            {
-                                Height = Application.GetRealHeight(160),
-                                Y = openframelayout.Bottom,
-                            };
-                            devicefra.AddChidren(closeframelayout);
-                            var closerowlayout = new RowLayout
-                            {
-                                Y = Application.GetRealHeight(30),
-                                Width = Application.GetRealWidth(920),
-                                Height = Application.GetRealHeight(130),
-                                X = Application.GetRealWidth(80),
-                                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                            };
-                            closeframelayout.AddChidren(closerowlayout);
-
-                            var btnclose = new Button
-                            {
-                                //Text = "鍏�",
-                                TextID = MyInternationalizationString.close,
-                                Width = Application.GetRealWidth(600),
-                                TextAlignment = TextAlignment.CenterLeft,
-                                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                                TextSize = 14,
-                            };
-                            closerowlayout.AddChidren(btnclose);
-
-                            var closeBtnSelected = new SelectedButton();
-                            closerowlayout.AddChidren(closeBtnSelected);
-                            #endregion
-                            #region   鍙栧弽
-                            var takebackframelayout = new FrameLayout
-                            {
-                                Height = Application.GetRealHeight(160),
-                                Y = closeframelayout.Bottom,
-                            };
-                            devicefra.AddChidren(takebackframelayout);
-                            var takebackrowlayout = new RowLayout
-                            {
-                                Y = Application.GetRealHeight(30),
-                                Width = Application.GetRealWidth(920),
-                                Height = Application.GetRealHeight(130),
-                                X = Application.GetRealWidth(80),
-                                LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                            };
-                            takebackframelayout.AddChidren(takebackrowlayout);
-
-                            var btntakeback = new Button
-                            {
-                                //Text = "鍏�",
-                                TextID = MyInternationalizationString.onoff,
-                                Width = Application.GetRealWidth(600),
-                                TextAlignment = TextAlignment.CenterLeft,
-                                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                                TextSize = 14,
-                            };
-                            takebackrowlayout.AddChidren(btntakeback);
-
-                            var takebackBtnSelected = new SelectedButton();
-                            takebackrowlayout.AddChidren(takebackBtnSelected);
-
-                            #endregion
-
-
-                            #endregion
-
-                            ///纭浜嬩欢
-                            EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                            {
-                                SelectedDeviceStatusaction = "yes";
-                                openBtnSelected.Visible = true;
-                                closeBtnSelected.Visible = false;
-                                takebackBtnSelected.Visible = false;
-                                if (switchdictionary.ContainsKey("Data1"))
-                                {
-                                    switchdictionary.Remove("Data1");
-                                }
-                                switchdictionary.Add("Data1", "1");//榛樿鍊�
-
-
-                            };
-                            openrowlayout.MouseUpEventHandler += openclick;
-                            btnopen.MouseUpEventHandler += openclick;
-                            openBtnSelected.MouseUpEventHandler += openclick;
-                            openframelayout.MouseUpEventHandler += openclick;
-                            ///鍙栨秷浜嬩欢
-                            EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                            {
-                                SelectedDeviceStatusaction = "yes";
-                                openBtnSelected.Visible = false;
-                                closeBtnSelected.Visible = true;
-                                takebackBtnSelected.Visible = false;
-                                if (switchdictionary.ContainsKey("Data1"))
-                                {
-                                    switchdictionary.Remove("Data1");
-                                }
-                                switchdictionary.Add("Data1", "0");//榛樿鍊�
-
-                            };
-                            closerowlayout.MouseUpEventHandler += closeclick;
-                            btnclose.MouseUpEventHandler += closeclick;
-                            closeBtnSelected.MouseUpEventHandler += closeclick;
-                            closeframelayout.MouseUpEventHandler += closeclick;
-                            //鍙栧弽
-                            EventHandler<MouseEventArgs> takebackclick = (sender, e) =>
-                            {
-                                SelectedDeviceStatusaction = "yes";
-                                openBtnSelected.Visible = false;
-                                closeBtnSelected.Visible = false;
-                                takebackBtnSelected.Visible = true;
-                                if (switchdictionary.ContainsKey("Data1"))
-                                {
-                                    switchdictionary.Remove("Data1");
-                                }
-                                switchdictionary.Add("Data1", "2");//榛樿鍊�
-
-                            };
-                            takebackrowlayout.MouseUpEventHandler += takebackclick;
-                            btntakeback.MouseUpEventHandler += takebackclick;
-                            takebackBtnSelected.MouseUpEventHandler += takebackclick;
-                            takebackframelayout.MouseUpEventHandler += takebackclick;
-                            if (edit && TaskList != null)
-                            {
-                                foreach (var value in TaskList)
-                                {
-                                    if (value["TaskType"] == "1")
-                                    {
-                                        if (switchdictionary.ContainsKey("Data1"))
-                                        {
-                                            switchdictionary.Remove("Data1");
-                                        }
-                                        if (value["Data1"] == "1")
-                                        {
-                                            switchdictionary.Add("Data1", "1");
-                                            openBtnSelected.Visible = true;
-                                            closeBtnSelected.Visible = false;
-                                            takebackBtnSelected.Visible = false;
-                                        }
-                                        else if (value["Data1"] == "0")
-                                        {
-                                            switchdictionary.Add("Data1", "0");
-                                            openBtnSelected.Visible = false;
-                                            closeBtnSelected.Visible = true;
-                                            takebackBtnSelected.Visible = false;
-                                        }
-                                        else if (value["Data1"] == "2")
-                                        {
-                                            switchdictionary.Add("Data1", "2");
-                                            openBtnSelected.Visible = false;
-                                            closeBtnSelected.Visible = false;
-                                            takebackBtnSelected.Visible = true;
-                                        }
-                                        break;
-                                    }
-
-                                }
-                            }
-
-                        }
-                    }
-                    break;
-                case DeviceType.Thermostat:
-                    {
-
-                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                        Dictionary<string, string> temperaturedictionary = new Dictionary<string, string>();
-                        Dictionary<string, string> modedictionary = new Dictionary<string, string>();
-                        Dictionary<string, string> speeddictionary = new Dictionary<string, string>();
-                        dictionary(temperaturedictionary, "TaskType", "5");
-                        dictionary(modedictionary, "TaskType", "5");
-                        dictionary(modedictionary, "Data1", "3");
-                        dictionary(speeddictionary, "TaskType", "5");
-                        dictionary(speeddictionary, "Data1", "6");
-                        taskListInfo.Add(temperaturedictionary);
-                        taskListInfo.Add(modedictionary);
-                        taskListInfo.Add(speeddictionary);
-                        #endregion
-
-                        #region  绌鸿皟View
-
-                        devicefra.Y = Application.GetRealHeight(1920 - 600 - 210 - 160 * 2);
-                        devicefra.Height = Application.GetRealHeight(600 + 210 + 160 * 2);
-
-                        #region 寮�
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-                        #endregion
-
-                        #region  绌鸿皟鐘舵�乂iew
-                        var PickerViewfra = new FrameLayout
-                        {
-                            Y = openframelayout.Bottom,
-                            Height = Application.GetRealHeight(600),
-                        };
-                        devicefra.AddChidren(PickerViewfra);
-
-                        //閬尅绌鸿皟婊戝姩view锛�
-                        var pausePickerViewfra = new FrameLayout
-                        {
-                            Y = openframelayout.Bottom,
-                            Height = Application.GetRealHeight(600),
-                            BackgroundColor = 0x60ffffff,
-                        };
-                        devicefra.AddChidren(pausePickerViewfra);
-
-                        var mUIPickerView = new UIPickerView
-                        {
-                            Height = Application.GetRealHeight(600 - 5),
-                        };
-                        PickerViewfra.AddChidren(mUIPickerView);
-                        var line = new Button
-                        {
-                            Y = Application.GetRealHeight(600 - 5),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(5),
-                            X = Application.GetRealWidth(80),
-                            BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        PickerViewfra.AddChidren(line);
-
-                        var mList1 = new List<string>();
-                        var mList2 = new List<string> {
-                         Language.StringByID(MyInternationalizationString.logiccool),
-                         Language.StringByID(MyInternationalizationString.logicheat),
-                         Language.StringByID(MyInternationalizationString.logicauto),
-                         Language.StringByID(MyInternationalizationString.logicdry),
-                         Language.StringByID(MyInternationalizationString.logicfanonly),
-                        };
-                        var mList3 = new List<string>{
-                         Language.StringByID(MyInternationalizationString.logiclow),
-                         Language.StringByID(MyInternationalizationString.logicmedium),
-                         Language.StringByID(MyInternationalizationString.logichigh),
-                          };
-                        for (int i = 16; i < 33; i++)
-                        {
-                            mList1.Add(i.ToString() + " " + "鈩�");
-                        }
-                        mUIPickerView.setNPicker(mList1, mList2, mList3);
-                        mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0);
-                        mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1);
-                        mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2);
-                        ///榛樿鐘舵��
-
-
-                        #endregion
-
-                        #region  鍏�
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = PickerViewfra.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-                        #endregion
-
-
-                        //榛樿26,鑷姩,涓
-                        int indextemperature = 10, indexmode = 2, indexspeed = 1;
-                        mUIPickerView.OnSelectChangeEvent += (s1, s2, s3) =>
-                        {
-                            indextemperature = s1;
-                            indexmode = s2;
-                            indexspeed = s3;
-                            if (openBtnSelected.Visible)
-                            {
-                                SelectedDeviceStatusaction = "yes";
-                                var temperature = mList1[s1].Split(' ')[0];
-                                var modestring = mList2[s2].Split(' ')[0];
-                                var speedstring = mList3[s3].Split(' ')[0];
-                                ModeState(modestring, temperaturedictionary, modedictionary);
-                                var a = int.Parse(temperature) * 100;
-                                dictionary(temperaturedictionary, "Data2", a.ToString());
-
-                                SpeedState(speedstring, speeddictionary);
-
-
-                            }
-                        };
-
-                        #endregion
-                     
-                        if (edit && TaskList != null)
-                        {
-                            foreach (var value in TaskList)
-                            {
-                                if (TaskList.Count == 1)
-                                {
-                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0);
-                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1);
-                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2);
-                                    //鏁扮粍鍙湁涓�涓厓绱犺鏄庡綋鍓嶇┖璋冪姸鎬佷负鍏筹紱
-                                    openBtnSelected.Visible = false;
-                                    closeBtnSelected.Visible = true;
-                                    pausePickerViewfra.Height = Application.GetRealHeight(600);
-                                    //濡傛灉绌鸿皟鐘舵�佹槸鍏筹紱鐩存帴璺冲嚭for寰潖锛�
-                                    break;
-
-                                }
-                                else
-                                {
-                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 0);
-                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 1);
-                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 2);
-                                    openBtnSelected.Visible = true;
-                                    closeBtnSelected.Visible = false;
-                                    pausePickerViewfra.Height = Application.GetRealHeight(0);
-                                }
-
-                                if (value["TaskType"] == "5")
-                                {
-                                    if (value["Data1"] == "3")
-                                    {//3---璁剧疆宸ヤ綔妯″紡(1:鑷姩;3:鍒跺喎;4:鍒剁儹;7:閫侀;8:闄ゆ箍)
-                                        dictionary(modedictionary, "Data2", value["Data2"]);
-                                        string modetext = "";
-                                        switch (value["Data2"])
-                                        {
-                                            case "3":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logiccool);
-                                                    //indexmode = 0;
-                                                }
-                                                break;
-                                            case "4":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logicheat);
-                                                    //  indexmode = 1;
-                                                }
-                                                break;
-                                            case "1":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logicauto);
-                                                    //   indexmode = 2;
-                                                }
-                                                break;
-                                            case "8":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logicdry);
-                                                    //  indexmode = 3;
-                                                }
-                                                break;
-                                            case "7":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logicfanonly);
-                                                    //indexmode = 4;
-                                                }
-                                                break;
-                                        }
-                                        indexmode = mList2.IndexOf(modetext);
-                                    }
-                                    else if (value["Data1"] == "6")
-                                    {//6---璁剧疆椋庢墖妯″紡(1:浣庨;2:涓;3:楂橀;)
-                                        dictionary(speeddictionary, "Data2", value["Data2"]);
-                                        string speedtext = "";
-                                        switch (value["Data2"])
-                                        {
-                                            case "1":
-                                                {
-                                                    speedtext = Language.StringByID(MyInternationalizationString.logiclow);
-                                                    //indexspeed = 0;
-                                                }
-                                                break;
-
-                                            case "2":
-                                                {
-                                                    speedtext = Language.StringByID(MyInternationalizationString.logicmedium);
-                                                    // indexspeed = 1;
-                                                }
-                                                break;
-                                            case "3":
-                                                {
-                                                    speedtext = Language.StringByID(MyInternationalizationString.logichigh);
-                                                    // indexspeed = 2;
-                                                }
-                                                break;
-
-                                        }
-                                        indexspeed = mList3.IndexOf(speedtext);
-                                    }
-                                    //4---璁剧疆鍔犵儹搴︽暟;5---璁剧疆鍒跺喎銆侀櫎婀垮害鏁�;7---璁剧疆鑷姩搴︽暟
-                                    else if (value["Data1"] == "4" || value["Data1"] == "5" || value["Data1"] == "7")
-                                    {
-                                        var s = int.Parse(value["Data2"]) / 100;
-                                        indextemperature = mList1.IndexOf(s.ToString() + " " + "鈩�");
-                                        dictionary(temperaturedictionary, "Data1", value["Data1"]);
-                                        dictionary(temperaturedictionary, "Data2", value["Data2"]);
-                                    }
-
-                                }
-                            }
-                        }
-                        ///鏇存柊鏈�鏂扮┖璋冪姸鎬侊紱
-                        mUIPickerView.setCurrentItems(indextemperature, indexmode, indexspeed);
-
-                        ///纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 0);
-                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 1);
-                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 2);
-                            //娓呴櫎涔嬪墠鏁版嵁锛�
-                            taskListInfo.Clear();
-                            //鍔犺浇鏂版暟鎹紱
-                            dictionary(temperaturedictionary, "TaskType", "5");
-                            dictionary(modedictionary, "TaskType", "5");
-                            dictionary(modedictionary, "Data1", "3");
-                            dictionary(speeddictionary, "TaskType", "5");
-                            dictionary(speeddictionary, "Data1", "6");
-                            taskListInfo.Add(temperaturedictionary);
-                            taskListInfo.Add(modedictionary);
-                            taskListInfo.Add(speeddictionary);
-                            pausePickerViewfra.Height = Application.GetRealHeight(0);
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            var temperature = mList1[indextemperature].Split(' ')[0];
-                            var modestring = mList2[indexmode].Split(' ')[0];
-                            var speedstring = mList3[indexspeed].Split(' ')[0];
-
-                            ModeState(modestring, temperaturedictionary, modedictionary);
-                            var a = int.Parse(temperature) * 100;
-                            dictionary(temperaturedictionary, "Data2", a.ToString());
-                            SpeedState(speedstring, speeddictionary);
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-
-                        ///鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0);
-                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1);
-                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2);
-                            //娓呴櫎涔嬪墠鏁版嵁锛�
-                            taskListInfo.Clear();
-                            dictionary(modedictionary, "TaskType", "5");
-                            dictionary(modedictionary, "Data1", "3");
-                            dictionary(modedictionary, "Data2", "0");
-                            //鍔犺浇鏂版暟鎹紱
-                            taskListInfo.Add(modedictionary);
-                            pausePickerViewfra.Height = Application.GetRealHeight(600);
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-                    }
-                    break;
-
-
-            }
-            Btncomplete.MouseUpEventHandler += (sender, e) =>
-            {
-
-                if (SelectedDeviceStatusaction == "yes")
-                {
-                    LogicIfon.AddDeviceactions(common, actionsInfo);
-                }
-                else
-                {
-                    if (!edit)
-                    {
-                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
-               Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
-               Language.StringByID(MyInternationalizationString.confrim));
-                        alert.Show();
-                        return;
-                    }
-
-                }
-                flMain.RemoveFromParent();
-                var lockLogicCommunalPage = new LockLogicCommunalPage();
-                UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                lockLogicCommunalPage.Show(() => { });
-
-            };
-
-        }
-
-        public static void dictionary(Dictionary<string, string> deviceactionsInfo, string Key, string Value)
-        {
-            if (deviceactionsInfo.ContainsKey(Key))
-            {
-                deviceactionsInfo.Remove(Key);
-            }
-            deviceactionsInfo.Add(Key, Value);
-        }
-        /// <summary>
-        /// 绌鸿皟妯″紡鐨勭姸鎬�
-        /// </summary>
-        /// <param name="modestring"></param>
-        /// <param name="temperaturedictionary"></param>
-        /// <param name="modedictionary"></param>
-        public static void ModeState(string modestring, Dictionary<string, string> temperaturedictionary, Dictionary<string, string> modedictionary)
-        {
-
-            if (modestring == Language.StringByID(MyInternationalizationString.logiccool))
-            {
-                dictionary(modedictionary, "Data2", "3");
-                dictionary(temperaturedictionary, "Data1", "5");
-            }
-            else if (modestring == Language.StringByID(MyInternationalizationString.logicheat))
-            {
-
-                dictionary(modedictionary, "Data2", "4");
-                dictionary(temperaturedictionary, "Data1", "4");
-            }
-            else if (modestring == Language.StringByID(MyInternationalizationString.logicauto))
-            {
-
-                dictionary(modedictionary, "Data2", "1");
-                dictionary(temperaturedictionary, "Data1", "7");
-            }
-            else if (modestring == Language.StringByID(MyInternationalizationString.logicdry))
-            {
-
-                dictionary(modedictionary, "Data2", "8");
-                dictionary(temperaturedictionary, "Data1", "5");
-            }
-            else if (modestring == Language.StringByID(MyInternationalizationString.logicfanonly))
-            {
-                dictionary(temperaturedictionary, "Data1", "20");
-                dictionary(modedictionary, "Data2", "7");
-            }
-
-        }
-        /// <summary>
-        /// 椋庨�熺殑妯″紡
-        /// </summary>
-        /// <param name="speedstring"></param>
-        /// <param name="speeddictionary"></param>
-        public static void SpeedState(string speedstring, Dictionary<string, string> speeddictionary)
-        {
-
-            if (speedstring == Language.StringByID(MyInternationalizationString.logiclow))
-            {
-
-                dictionary(speeddictionary, "Data2", "1");
-
-            }
-            else if (speedstring == Language.StringByID(MyInternationalizationString.logicmedium))
-            {
-
-                dictionary(speeddictionary, "Data2", "2");
-
-            }
-            else if (speedstring == Language.StringByID(MyInternationalizationString.logichigh))
-            {
-
-                dictionary(speeddictionary, "Data2", "3");
-            }
-
-        }
-    }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddScene.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddScene.cs
deleted file mode 100644
index 48def34..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockAddScene.cs
+++ /dev/null
@@ -1,462 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Newtonsoft.Json.Linq;
-using Shared;
-using Shared.Common;
-using Shared.Phone;
-using Shared.R;
-using ZigBee.Device;
-namespace Shared.Phone.Device.Logic.DoorLockLogic
-{
-    public class LockAddScene:FrameLayout
-    {
-        public LockAddScene()
-        {
-            Tag = "LockLogic";
-        }
-        Button roombjButton = new Button();
-        Button roomTextButton = new Button();
-        Button clickbutton = new Button();
-        HorizontalScrolViewLayout roomhorizontalScrol;
-        VerticalScrolViewLayout middle;
-        public string clickTag = "no";
-        public SceneUI tempScene = null;
-        Dictionary<string, object> actionsInfo = new Dictionary<string, object>();
-        public void Show()
-        {
-            UserView.HomePage.Instance.ScrollEnabled = false;
-            this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(160),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.addscene,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var foolrname = new Button
-            {
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterRight,
-                X = Application.GetRealWidth(1080 - 400 - 120),
-                Width = Application.GetRealWidth(400),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                //TextID = MyInternationalizationString.customroom,
-                Text = Config.Instance.Home.GetCurrentFloorName,
-                TextSize = 14,
-            };
-            topRowLayout.AddChidren(foolrname);
-            var dropdown = new Button
-            {
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterRight,
-                X = foolrname.Right,
-                Width = Application.GetRealWidth(72),
-                Height = Application.GetRealHeight(72),
-                Y = Application.GetRealHeight(92),
-                UnSelectedImagePath = "ZigeeLogic/drop-down.png",
-            };
-            topRowLayout.AddChidren(dropdown);
-            #endregion
-
-            ///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱
-            if (Common.Room.Lists.Count == 0)
-            {
-                return;
-            }
-            ///鎴块棿婊戝姩鎺т欢
-            roomhorizontalScrol = new HorizontalScrolViewLayout()
-            {
-                Width = Application.GetRealWidth(1080 - 58),
-                Height = Application.GetRealHeight(200),
-                Y = topRowLayout.Bottom,
-                X = Application.GetRealWidth(58),
-            };
-            this.AddChidren(roomhorizontalScrol);
-
-
-
-            middle = new VerticalScrolViewLayout();
-            middle.Y = roomhorizontalScrol.Bottom;
-            middle.Height = Application.GetRealHeight(1920 - 260 - 200 - 184);
-            middle.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-            this.AddChidren(middle);
-
-            var saveframeLayout = new FrameLayout
-            {
-                Y = middle.Bottom,
-                Height = Application.GetRealHeight(260),
-                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-            };
-            this.AddChidren(saveframeLayout);
-
-            var btnsave = new Button
-            {
-                X = Application.GetRealWidth(85),
-                Height = Application.GetRealHeight(130),
-                Width = Application.GetRealWidth(910),
-                Radius = (uint)Application.GetRealHeight(60),
-                BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
-                TextID = MyInternationalizationString.Save,
-                TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                TextSize = 16,
-            };
-            saveframeLayout.AddChidren(btnsave);
-
-            btnsave.MouseUpEventHandler += (sender2, e2) =>
-            {
-                if (clickTag == "no" || tempScene == null)
-                {
-                    var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
-           Language.StringByID(MyInternationalizationString.scenetip),
-           Language.StringByID(MyInternationalizationString.confrim));
-                    alert.Show();
-                    return;
-                }
-                if (actionsInfo.ContainsKey("LinkType"))
-                {
-                    actionsInfo.Remove("LinkType");
-                }
-                actionsInfo.Add("LinkType", 2);
-                LogicIfon.AddSceneactions(tempScene, actionsInfo);
-                var lockLogicCommunalPage = new LockLogicCommunalPage();
-                UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                lockLogicCommunalPage.Show(() => { });
-
-            };
-
-            ///妤煎眰鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> foorlclick = (sender, e) =>
-            {
-
-                var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                this.AddChidren(flMain);
-                flMain.MouseUpEventHandler += (sender2, e2) =>
-                {
-                    flMain.RemoveFromParent();
-                };
-                var foolrbjicon = new FrameLayout
-                {
-
-                    Width = Application.GetRealWidth(450),
-                    Height = Application.GetRealHeight(780),
-                    X = Application.GetRealWidth(1080 - 468 - 35),
-                    Y = Application.GetRealHeight(184),
-                    BackgroundImagePath = "Item/SelectFloor_Right.png",
-                };
-                flMain.AddChidren(foolrbjicon);
-
-                var btnfoolrtext = new Button
-                {
-                    Width = Application.GetRealWidth(450),
-                    Height = Application.GetRealHeight(150),
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    X = Application.GetRealWidth(80),
-                    TextID = MyInternationalizationString.selecfoolr,
-                    TextSize = 14,
-                };
-                foolrbjicon.AddChidren(btnfoolrtext);
-
-                var foolrbj = new VerticalScrolViewLayout
-                {
-
-                    Width = Application.GetRealWidth(450),
-                    Height = foolrbjicon.Height - btnfoolrtext.Height,
-                    X = Application.GetRealWidth(80),
-                    Y = btnfoolrtext.Bottom,
-                };
-                foolrbjicon.AddChidren(foolrbj);
-
-                foreach (var foolr in Config.Instance.Home.FloorDics)
-                {
-                    var foolrRowLayout = new RowLayout
-                    {
-                        Height = Application.GetRealHeight(150),
-                        LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-                    };
-                    foolrbj.AddChidren(foolrRowLayout);
-
-                    var btnfoolricon = new Button
-                    {
-                        Width = Application.GetRealWidth(81),
-                        Height = Application.GetRealHeight(81),
-                        UnSelectedImagePath = "Floor/Floor.png",
-                        Gravity = Gravity.CenterVertical,
-                    };
-                    foolrRowLayout.AddChidren(btnfoolricon);
-
-
-                    var btnfoolrname = new Button
-                    {
-                        Width = Application.GetRealWidth(250),
-                        Height = Application.GetRealHeight(150),
-                        Text = foolr.Value,
-                        TextAlignment = TextAlignment.CenterLeft,
-                        TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                        Tag = foolr.Key,
-                        X = btnfoolricon.Right + Application.GetRealWidth(12),
-                        TextSize = 14,
-                    };
-                    foolrRowLayout.AddChidren(btnfoolrname);
-                    if (foolrname.Text == foolr.Value)
-                    {
-                        btnfoolricon.UnSelectedImagePath = "Floor/FloorSelected.png";
-                        btnfoolrname.TextColor = ZigbeeColor.Current.LogicTextBlackColor;
-                    }
-
-                    EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) =>
-                    {
-                        roomhorizontalScrol.RemoveAll();
-                        foolrname.Text = btnfoolrname.Text;
-                        middle.RemoveAll();
-                        flMain.RemoveFromParent();
-                        var list = Send.GetRoomList(btnfoolrname.Tag.ToString());
-                        AllRoomView(list);
-
-                    };
-                    foolrRowLayout.MouseUpEventHandler += foolrnameclick;
-                    btnfoolrname.MouseUpEventHandler += foolrnameclick;
-
-
-                }
-
-            };
-            foolrname.MouseUpEventHandler += foorlclick;
-            dropdown.MouseUpEventHandler += foorlclick;
-
-            ///绗竴娆¤繘鏉�
-            var roomlists = new List<Common.Room>();
-            roomlists.Clear();
-            if (Config.Instance.Home.FloorDics.Count < 2)
-            {
-                foolrname.Visible = false;
-                dropdown.Visible = false;
-                if (Config.Instance.Home.FloorDics.Count == 0)
-                {
-                    roomlists.AddRange(Common.Room.Lists);
-                }
-                else
-                {
-                    roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
-                }
-            }
-            else
-            {
-                roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
-
-            }
-
-
-            ///绗竴娆¤繘鏉�
-            AllRoomView(roomlists);
-
-        }
-        /// <summary>
-        /// 鏄剧ず鎵�鏈夋埧闂寸殑鏂规硶
-        /// </summary>
-        /// <param name="RoomList"></param>
-        void AllRoomView(List<Common.Room> RoomList)
-        {
-            for (int i = 0; i < RoomList.Count; i++)
-            {
-                var room = RoomList[i];
-                var fra = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(200),
-                    Width = Application.GetRealWidth(255),
-                };
-                roomhorizontalScrol.AddChidren(fra);
-
-                var roombjBtn = new Button
-                {
-                    Height = Application.GetRealHeight(158),
-                    Width = Application.GetRealWidth(255),
-                    UnSelectedImagePath = "ZigeeLogic/iconBackgroundColor.png",
-                    SelectedImagePath = "ZigeeLogic/iconSelectedBackgroundColor.png",
-                    Y = Application.GetRealHeight(21),
-                };
-                fra.AddChidren(roombjBtn);
-
-                var roomnameBtn = new Button
-                {
-
-                    Height = Application.GetRealHeight(152 - 26 - 20),
-                    Width = Application.GetRealWidth(255 - 20 - 50),
-                    Text = room.Name,
-                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                    SelectedTextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    Y = Application.GetRealHeight(21 + 13 + 10),
-                    X = Application.GetRealWidth(10 + 25),
-
-                };
-                fra.AddChidren(roomnameBtn);
-
-                if (i == 0)
-                {
-                    roombjButton.IsSelected = false;
-                    roombjButton = roombjBtn;
-                    roombjBtn.IsSelected = true;
-
-                    roomTextButton.IsSelected = false;
-                    roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
-                    SceneView(room.SceneUIList);
-
-                }
-
-                EventHandler<MouseEventArgs> roomclick = (sender, e) =>
-                {
-
-                    clickTag = "no";
-                    tempScene = null;
-                    clickbutton = null;
-                    clickbutton = new Button();
-
-                    roombjButton.IsSelected = false;
-                    roombjButton = roombjBtn;
-                    roombjBtn.IsSelected = true;
-
-                    roomTextButton.IsSelected = false;
-                    roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
-                    SceneView(room.SceneUIList);
-                };
-                roomnameBtn.MouseUpEventHandler += roomclick;
-                roombjBtn.MouseUpEventHandler += roomclick;
-
-            }
-        }
-        /// <summary>
-        /// 鏄剧ず鎵�鏈夌殑鍦烘櫙鐨勬柟娉�
-        /// </summary>
-        /// <param name="scenelist"></param>
-        void SceneView(List<SceneUI> scenelist)
-        {
-            middle.RemoveAll();
-            foreach (var scene in scenelist)
-            {
-                var sceneFramelayout = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(160),
-                    BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                };
-                middle.AddChidren(sceneFramelayout);
-
-
-                var sceneIconBtn = new Button
-                {
-                    Width = Application.GetRealWidth(81),
-                    Height = Application.GetRealHeight(81),
-                    X = Application.GetRealWidth(58),
-                    Y = Application.GetRealHeight(55),
-                    UnSelectedImagePath = "ZigeeLogic/scene.png",
-
-                };
-                sceneFramelayout.AddChidren(sceneIconBtn);
-
-                var sceneRow = new RowLayout
-                {
-                    Y = Application.GetRealHeight(30),
-                    Width = Application.GetRealWidth(850),
-                    Height = Application.GetRealHeight(130),
-                    X = Application.GetRealWidth(176 + 10),
-                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-
-                };
-                sceneFramelayout.AddChidren(sceneRow);
-
-                var scenename = new Button
-                {
-                    Text = scene.Name,
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    SelectedTextColor = ZigbeeColor.Current.LogicAddColor,
-                    TextSize = 14,
-                };
-                sceneRow.AddChidren(scenename);
-
-                var selectedBtn = new Button
-                {
-                    Width = Application.GetRealWidth(58),
-                    Height = Application.GetRealHeight(58),
-                    X = Application.GetRealWidth(789),
-                    UnSelectedImagePath = "ZigeeLogic/selected.png",
-                    Visible = false,
-                    Gravity = Gravity.CenterVertical,
-                };
-                sceneRow.AddChidren(selectedBtn);
-
-                EventHandler<MouseEventArgs> sceneclick = (sender, e) =>
-                {
-                    tempScene = scene;
-                    clickTag = "yes";
-                    clickbutton.Visible = false;
-                    clickbutton = selectedBtn;
-                    selectedBtn.Visible = true;
-                    if (actionsInfo.ContainsKey("DeviceAddr"))
-                    {
-                        actionsInfo.Remove("DeviceAddr");
-                    }
-                    actionsInfo.Add("DeviceAddr", scene.Id);
-                };
-
-                sceneFramelayout.MouseUpEventHandler += sceneclick;
-                sceneIconBtn.MouseUpEventHandler += sceneclick;
-                sceneRow.MouseUpEventHandler += sceneclick;
-                scenename.MouseUpEventHandler += sceneclick;
-                selectedBtn.MouseUpEventHandler += sceneclick;
-
-            }
-
-        }
-
-
-
-    }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
index 1642b5c..30c1a07 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
@@ -14,83 +14,42 @@
 
         public LockLogicCommunalPage()
         {
-            UserView.HomePage.Instance.RemoveViewByTag("LockLogic");
-            Tag = "LockLogic";
+            UserView.HomePage.Instance.RemoveViewByTag("Logic");
+            Tag = "Logic";
         }
         EditText logicTextBox;
         public async void Show(Action action)
         {
 
             #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.selection,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
             if (Common.Logic.CurrentLogic.LogicId != 0)
             {
-                titleName.Text = Language.StringByID(MyInternationalizationString.editlinkageevent);
+                view.toptitleNameBtn.Text = Language.StringByID(MyInternationalizationString.editlinkageevent);
             }
             else
             {
-                titleName.Text = Language.StringByID(MyInternationalizationString.addlinkageevent);
+                view.toptitleNameBtn.Text = Language.StringByID(MyInternationalizationString.addlinkageevent);
             }
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
+            view.clickBtn.MouseDownEventHandler += (sender, e) =>
             {
                 action();
                 RemoveFromParent();
             };
-
-            #endregion
-
-
             var middle = new VerticalScrolViewLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184 - 180),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
 
+            var saveBtn = new LogicView.SaveView();
+            saveBtn.frameLayout.Y = middle.Bottom;
+            saveBtn.frameLayout.Height = Application.GetRealHeight(180);
+            this.AddChidren(saveBtn.Show());
+            #endregion
 
             #region -----鑷姩鍖栧悕绉� 璁剧疆鍚嶇О-----
             var logicnamefl = new FrameLayout
@@ -136,68 +95,16 @@
             #endregion
 
             #region -----鏄剧ず閫昏緫鏉′欢-----
-
-
-            var conditionFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(conditionFrameLayout);
-
-
-            var conditionRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            conditionFrameLayout.AddChidren(conditionRowLayout);
-
-
-            conditionRowLayout.AddChidren(new Button
-            {
-
-                Text = Language.StringByID(MyInternationalizationString.ifcondition),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(60),
-                TextSize = 15,
-                Gravity = Gravity.CenterVertical,
-            });
-
-            var conditionadd1 = new Button
-            {
-
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(57),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(965 + 58),
-
-            };
-            conditionFrameLayout.AddChidren(conditionadd1);
-
-            var conditionadd = new Button
-            {
-
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/add.png",
-                X = Application.GetRealWidth(965 - 58),
-                Gravity = Gravity.CenterVertical,
-
-            };
-            conditionRowLayout.AddChidren(conditionadd);
+            LogicView.Addview addconditionview = new LogicView.Addview();
+            addconditionview.iconBtn.Visible = true;
+            addconditionview.titleBtn.TextID = MyInternationalizationString.ifcondition;
+            middle.AddChidren(addconditionview.AddDeviceView());
             ///娣诲姞鏉′欢鐨勭偣鍑讳簨浠�
-            EventHandler<MouseEventArgs> conditionaddclick = (sender, e) =>
+            addconditionview.clickBtn.MouseUpEventHandler = (sender, e) =>
             {
                 AddCondition(-1);
             };
-            conditionadd.MouseUpEventHandler += conditionaddclick;
-            conditionadd1.MouseUpEventHandler += conditionaddclick;
+
             List<Dictionary<string, string>> ListConditions = new List<Dictionary<string, string>>();
             ListConditions.Clear();
             ListConditions.AddRange(Common.Logic.CurrentLogic.Conditions);
@@ -207,153 +114,43 @@
                 if (i == (ListConditions.Count - 1))
                 {
 
-                    var addfl = new FrameLayout
-                    {
-                        Height = Application.GetRealHeight(160 + 30 + 50),
-                        BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    };
-                    middle.AddChidren(addfl);
-                    var addbtn = new Button
-                    {
-                        Height = Application.GetRealHeight(130 + 50),
-                        Width = Application.GetRealWidth(908),
-                        Y = Application.GetRealHeight(30),
-                        X = Application.GetRealWidth(86),
-                        UnSelectedImagePath = "ZigeeLogic/logicaddcolor.png",
-                    };
-                    addfl.AddChidren(addbtn);
+                    LogicView.AddDeviceView addflview = new LogicView.AddDeviceView();
+                    addflview.titleBtn.TextID = MyInternationalizationString.selectunlockingmode;
+                    middle.AddChidren(addflview.AddFl());
+                    addflview.clickBtn.MouseUpEventHandler += (sender, e) =>
+                     {
+                         AddCondition(-1);
+                     };
 
-
-                    var addtextbtn = new Button
-                    {
-                        Height = Application.GetRealHeight(58),
-                        Width = Application.GetRealWidth(500),
-                        Y = Application.GetRealHeight(45 + 30),
-                        TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                        TextID = MyInternationalizationString.selectunlockingmode,
-                        X = Application.GetRealWidth(290),
-                        TextSize = 14,
-                    };
-                    addfl.AddChidren(addtextbtn);
-
-                    EventHandler<MouseEventArgs> addconditionsclick = (sender, e) =>
-                    {
-                        AddCondition(-1);
-                    };
-                    addbtn.MouseUpEventHandler += addconditionsclick;
-                    addtextbtn.MouseUpEventHandler += addconditionsclick;
                 }
                 else
                 {
-                    var devicesFrameLayout = new FrameLayout
-                    {
-                        Height = Application.GetRealHeight(130),
-                        BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    };
-                    middle.AddChidren(devicesFrameLayout);
-
-                    ///鏄剧ず鍥炬爣
-                    var conditionIcon = new Button
-                    {
-                        Width = Application.GetRealWidth(81),
-                        Height = Application.GetRealHeight(81),
-                        X = Application.GetRealWidth(104),
-                        Y = Application.GetRealHeight(25),
-                        //UnSelectedImagePath = "ZigeeLogic/time.png",
-
-                    };
-                    devicesFrameLayout.AddChidren(conditionIcon);
-
-
-                    var conditionsRowLayout = new RowLayout
-                    {
-                        Width = Application.GetRealWidth(800),
-                        Height = Application.GetRealHeight(130),
-                        X = Application.GetRealWidth(222),
-                        LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                    };
-                    devicesFrameLayout.AddChidren(conditionsRowLayout);
-
+                    SelectedDeviceView selecteddevice = new SelectedDeviceView();
+                    selecteddevice.Show(middle);
                     var Type = int.Parse(ListConditions[i]["Type"]);
                     var conditions = ListConditions[i];
                     switch (Type)
                     {
                         case 1:
                             {
-                                var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return obj.DeviceAddr == conditions["MacAddr"] && obj.DeviceEpoint.ToString() == conditions["Epoint"]; });
-                                if (deviceinof == null)
-                                {
-                                    deviceinof = new ZigBee.Device.CommonDevice();
-                                    //continue;
-                                }
-                                ///鏄剧ず璁惧鍚嶇О
-                                var btndevice = new Button
-                                {
-                                    Y = Application.GetRealHeight(20),
-                                    Height = Application.GetRealHeight(50),
-                                    Width = Application.GetRealWidth(400),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Text = deviceinof.DeviceEpointName,
-                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                                    TextSize = 14,
-                                };
-                                conditionsRowLayout.AddChidren(btndevice);
-
-                                ///鍖哄煙(鎴块棿)鍚嶇ОButton
-                                var btnregionname = new Button
-                                {
-                                    Y = btndevice.Bottom + Application.GetRealHeight(10),
-                                    Width = Application.GetRealWidth(400),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Height = Application.GetRealHeight(50),
-                                    Text = "",//Language.StringByID(MyInternationalizationString.customroom),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                };
-                                conditionsRowLayout.AddChidren(btnregionname);
-                                ///閫氳繃璁惧鎵惧埌鍖哄煙(鎴块棿)鍚嶇О
-                                Device.Logic.Send.RoomNmae(btnregionname, deviceinof);
-
-
-                                var deviceedit = new Button
-                                {
-                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
-                                    Text = Language.StringByID(MyInternationalizationString.edit),
-                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                                    Tag = i,
-                                };
-                                conditionsRowLayout.AddRightView(deviceedit);
-                                deviceedit.MouseUpEventHandler += (sender, e) =>
-                                {
-
-                                    int intvalue = int.Parse(deviceedit.Tag.ToString());
-                                    AddCondition(intvalue);
-                                };
-
-                                ///鏄剧ず璁惧鏉′欢鐘舵�佹帶浠�
-                                var devicestatus = new Button
-                                {
-                                    Width = Application.GetRealWidth(400),
-                                    Height = Application.GetRealHeight(130),
-                                    Gravity = Gravity.CenterVertical,
-                                    TextAlignment = TextAlignment.CenterRight,
-                                    X = Application.GetRealWidth(400),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    TextSize = 14,
-                                };
-                                conditionsRowLayout.AddChidren(devicestatus);
-
+                                var deviceinof = Method.GetCommonDevice(conditions["MacAddr"], conditions["Epoint"]);
+                                selecteddevice.deviceNameBtn.Visible = true;
+                                selecteddevice.deviceNameBtn.Text = deviceinof.DeviceEpointName;
+                                selecteddevice.regionNameBtn.Visible = true;
+                                Method.RoomNmae(selecteddevice.regionNameBtn, deviceinof);
+                                selecteddevice.edit.Tag = i;
                                 switch (deviceinof.Type)
                                 {
                                     case DeviceType.DoorLock:
                                         {
-                                            conditionIcon.UnSelectedImagePath = "ZigeeLogic/doorlock.png";
+                                            selecteddevice.iconBtn.UnSelectedImagePath = "ZigeeLogic/doorlock.png";
                                             for (int a = 0; a < Common.Logic.CurrentLogic.Accounts.Count; a++)
                                             {
                                                 if (Common.Logic.CurrentLogic.Accounts[a]["Type"] == "1")
                                                 {
                                                     if (Common.Logic.CurrentLogic.Accounts[a]["UserId"] == conditions["AttriButeData2"])
                                                     {
-                                                        devicestatus.Text = Common.Logic.CurrentLogic.Accounts[a]["AccountName"];
+                                                        selecteddevice.selecetddevicestateBtn.Text = Common.Logic.CurrentLogic.Accounts[a]["Account"];
                                                         break;
                                                     }
                                                 }
@@ -365,18 +162,19 @@
                             }
                             break;
                     }
-                    ///鍒犻櫎鎺т欢
-                    var del = new Button
+
+                    ///缂栬緫
+                    selecteddevice.edit.MouseUpEventHandler += (sender, e) =>
                     {
-                        BackgroundColor = ZigbeeColor.Current.LogicDelBlackColor1,
-                        Text = Language.StringByID(MyInternationalizationString.del),
+                        int intvalue = int.Parse(selecteddevice.edit.Tag.ToString());
+                        AddCondition(intvalue);
                     };
-                    conditionsRowLayout.AddRightView(del);
-                    del.MouseUpEventHandler += (sender, e) =>
+                    ///鍒犻櫎鎺т欢
+                    selecteddevice.del.MouseUpEventHandler += (sender, e) =>
                     {
                         var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
-                       Language.StringByID(MyInternationalizationString.doyouwanttodelete),
-                       Language.StringByID(MyInternationalizationString.confrim));
+                      Language.StringByID(MyInternationalizationString.doyouwanttodelete),
+                      Language.StringByID(MyInternationalizationString.confrim));
                         alert.Show();
                         alert.ConfirmClickEvent += () =>
                         {
@@ -386,7 +184,6 @@
                             UserView.HomePage.Instance.PageIndex += 1;
                             lockLogicCommunalPage.Show(() => { });
                         };
-
                     };
 
                 }
@@ -396,59 +193,12 @@
             #endregion
 
             #region  ----鏄剧ず鎵ц鐩爣----
+            LogicView.Addview addactionview = new LogicView.Addview();
+            addactionview.iconBtn.Visible = true;
+            addactionview.titleBtn.TextID = MyInternationalizationString.execute;
+            middle.AddChidren(addactionview.AddDeviceView());
 
-            var targetFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(targetFrameLayout);
-
-
-            var targetRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            targetFrameLayout.AddChidren(targetRowLayout);
-
-
-            var btntargettitle = new Button
-            {
-
-                Text = Language.StringByID(MyInternationalizationString.execute),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(60),
-                TextSize = 15,
-                Gravity = Gravity.CenterVertical,
-            };
-            targetRowLayout.AddChidren(btntargettitle);
-
-            var btntargetadd1 = new Button
-            {
-
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(57),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(965 + 58),
-            };
-            targetFrameLayout.AddChidren(btntargetadd1);
-
-            var btntargetadd = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/add.png",
-                X = Application.GetRealWidth(965 - 58),
-                Gravity = Gravity.CenterVertical,
-            };
-            targetRowLayout.AddChidren(btntargetadd);
-            EventHandler<MouseEventArgs> btntargetaddclick = (sender, e) =>
+            addactionview.clickBtn.MouseUpEventHandler += (sender, e) =>
             {
                 Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
                 var addAction = new AddAction();
@@ -456,8 +206,6 @@
                 UserView.HomePage.Instance.PageIndex += 1;
                 addAction.Show();
             };
-            btntargetadd1.MouseUpEventHandler += btntargetaddclick;
-            btntargetadd.MouseUpEventHandler += btntargetaddclick;
 
             List<Dictionary<string, object>> ListActions = new List<Dictionary<string, object>>();
             ListActions.Clear();
@@ -469,35 +217,10 @@
                 if (i == (ListActions.Count - 1))
                 {
 
-                    var addfl = new FrameLayout
-                    {
-                        Height = Application.GetRealHeight(160 + 30 + 50),
-                        BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    };
-                    middle.AddChidren(addfl);
-                    var addbtn = new Button
-                    {
-                        Height = Application.GetRealHeight(130 + 50),
-                        Width = Application.GetRealWidth(908),
-                        Y = Application.GetRealHeight(30),
-                        X = Application.GetRealWidth(86),
-                        UnSelectedImagePath = "ZigeeLogic/logicaddcolor.png",
-                    };
-                    addfl.AddChidren(addbtn);
-
-
-                    var addtextbtn = new Button
-                    {
-                        Height = Application.GetRealHeight(58),
-                        Width = Application.GetRealWidth(300),
-                        Y = Application.GetRealHeight(45 + 30),
-                        TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                        TextID = MyInternationalizationString.lockaddaction,
-                        X = Application.GetRealWidth(390),
-                        TextSize = 14,
-                    };
-                    addfl.AddChidren(addtextbtn);
-                    EventHandler<MouseEventArgs> addfunctionclick = (sender, e) =>
+                    LogicView.AddDeviceView addflview = new LogicView.AddDeviceView();
+                    addflview.titleBtn.TextID = MyInternationalizationString.selectunlockingmode;
+                    middle.AddChidren(addflview.AddFl());
+                    addflview.clickBtn.MouseUpEventHandler += (sender, e) =>
                     {
                         Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
                         var addAction = new AddAction();
@@ -505,121 +228,32 @@
                         UserView.HomePage.Instance.PageIndex += 1;
                         addAction.Show();
                     };
-                    addbtn.MouseUpEventHandler += addfunctionclick;
-                    addtextbtn.MouseUpEventHandler += addfunctionclick;
                 }
                 else
                 {
 
-                    var devicesFrameLayout = new FrameLayout
-                    {
-                        Height = Application.GetRealHeight(130),
-                        BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    };
-                    middle.AddChidren(devicesFrameLayout);
-
-                    ///鏄剧ず鍥炬爣
-                    var actionsIcon = new Button
-                    {
-                        Width = Application.GetRealWidth(81),
-                        Height = Application.GetRealHeight(81),
-                        X = Application.GetRealWidth(104),
-                        Y = Application.GetRealHeight(25),
-                        // UnSelectedImagePath = "ZigeeLogic/time.png",
-
-                    };
-                    devicesFrameLayout.AddChidren(actionsIcon);
-
-
-                    var actionsrowLayout = new RowLayout
-                    {
-                        Width = Application.GetRealWidth(800),
-                        Height = Application.GetRealHeight(130),
-                        X = Application.GetRealWidth(222),
-                        LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                    };
-                    devicesFrameLayout.AddChidren(actionsrowLayout);
-
-
+                    SelectedDeviceView actiondevice = new SelectedDeviceView();
+                    actiondevice.Show(middle);
                     var linkType = int.Parse(ListActions[i]["LinkType"].ToString());
                     var actions = ListActions[i];
-
+                    string name = "";
+                    string icon = "";
+                    string state = "";
                     switch (linkType)
                     {
                         case 0:
                             {
-                                var obj1 = actions["DeviceAddr"].ToString();
-                                var obj2 = actions["Epoint"].ToString();
-                                var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return ((obj.DeviceAddr == obj1) && (obj.DeviceEpoint.ToString() == obj2)); });
-                                if (deviceinof == null)
-                                {
-                                    deviceinof = new ZigBee.Device.CommonDevice();
-                                    //continue;
-                                }
 
-                                ///璁惧鍚嶇ОButton
-                                var btndevicename = new Button
-                                {
-                                    Y = Application.GetRealHeight(20),
-                                    Height = Application.GetRealHeight(50),
-                                    Width = Application.GetRealWidth(450),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Text = deviceinof.DeviceEpointName,
-                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                                    TextSize = 14,
-                                };
-                                actionsrowLayout.AddChidren(btndevicename);
-
-                                ///鍖哄煙(鎴块棿)鍚嶇ОButton
-                                var btnregionname = new Button
-                                {
-                                    Y = btndevicename.Bottom + Application.GetRealHeight(10),
-                                    Width = Application.GetRealWidth(450),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Height = Application.GetRealHeight(50),
-                                    Text = "",//Language.StringByID(MyInternationalizationString.customroom),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                };
-                                actionsrowLayout.AddChidren(btnregionname);
-                                ///閫氳繃璁惧鎵惧埌鍖哄煙(鎴块棿)鍚嶇О
-                                Device.Logic.Send.RoomNmae(btnregionname, deviceinof);
-                                ///鏄剧ず璁惧鏉′欢鐘舵�佹帶浠�
-                                var devicestatus = new Button
-                                {
-                                    Width = Application.GetRealWidth(350),
-                                    Height = Application.GetRealHeight(130),
-                                    Gravity = Gravity.CenterVertical,
-                                    TextAlignment = TextAlignment.CenterRight,
-                                    X = Application.GetRealWidth(450),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    TextSize = 14,
-                                };
-                                actionsrowLayout.AddChidren(devicestatus);
-
-                                ///缂栬緫璁惧鐘舵�丅utton
-                                var deviceedit = new Button
-                                {
-                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
-                                    Text = Language.StringByID(MyInternationalizationString.edit),
-                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                                };
-                                actionsrowLayout.AddRightView(deviceedit);
-
-                                ///缂栬緫鐐瑰嚮浜嬩欢
-                                deviceedit.MouseUpEventHandler += (sender, e) =>
-                                {
-
-                                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                                    this.AddChidren(flMain);
-                                    LockAddDevice.CurrentDeviceStateView(flMain, deviceinof, true);
-                                };
-
+                                var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString());
+                                name = deviceinof.DeviceEpointName;
+                                actiondevice.regionNameBtn.Visible = true;
+                                Method.RoomNmae(actiondevice.regionNameBtn, deviceinof);
 
                                 switch (deviceinof.Type)
                                 {
                                     case DeviceType.OnOffOutput:
                                         {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/light.png";
+                                            icon = "ZigeeLogic/light.png";
 
                                             var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
                                             if (TaskList == null)
@@ -632,18 +266,18 @@
                                                 {
                                                     if (status["Data1"].ToString() == "0")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
+                                                        state = Language.StringByID(MyInternationalizationString.close);
 
                                                     }
                                                     else if (status["Data1"].ToString() == "1")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.open);
+                                                        state = Language.StringByID(MyInternationalizationString.open);
 
                                                     }
                                                     else if (status["Data1"].ToString() == "2")
                                                     {
 
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.onoff);
+                                                        state = Language.StringByID(MyInternationalizationString.onoff);
                                                     }
                                                 }
 
@@ -653,7 +287,7 @@
                                         break;
                                     case DeviceType.DimmableLight:
                                         {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/dimmableLight.png";
+                                            icon = "ZigeeLogic/dimmableLight.png";
                                             var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
                                             if (TaskList == null)
                                             {
@@ -665,18 +299,18 @@
                                                 {
                                                     var intvalue = int.Parse(status["Data1"]);
                                                     var lightbrightnessvalue = (intvalue * 100) / 254;
-                                                    devicestatus.Text = lightbrightnessvalue.ToString() + "%";
+                                                    state = lightbrightnessvalue.ToString() + "%";
                                                 }
                                                 else if (status["TaskType"].ToString() == "1")
                                                 {
 
                                                     if (status["Data1"].ToString() == "0")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
+                                                        state = Language.StringByID(MyInternationalizationString.close);
                                                     }
                                                     else if (status["Data1"].ToString() == "2")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.onoff);
+                                                        state = Language.StringByID(MyInternationalizationString.onoff);
                                                     }
                                                 }
 
@@ -687,7 +321,7 @@
                                         break;
                                     case DeviceType.WindowCoveringDevice:
                                         {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/curtain.png";
+                                            icon = "ZigeeLogic/curtain.png";
                                             var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
                                             if (TaskList == null)
                                             {
@@ -699,15 +333,15 @@
                                                 {
                                                     if (status["Data1"] == "0")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.open);
+                                                        state = Language.StringByID(MyInternationalizationString.open);
                                                     }
                                                     else if (status["Data1"] == "1")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
+                                                        state = Language.StringByID(MyInternationalizationString.close);
                                                     }
                                                     else if (status["Data1"] == "5")
                                                     {
-                                                        devicestatus.Text = status["Data2"] + "%";
+                                                        state = status["Data2"] + "%";
                                                     }
                                                 }
 
@@ -716,7 +350,7 @@
                                         break;
                                     case DeviceType.AirSwitch:
                                         {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/airswitch.png";
+                                            icon = "ZigeeLogic/airswitch.png";
 
                                             var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
                                             if (TaskList == null)
@@ -729,18 +363,18 @@
                                                 {
                                                     if (status["Data1"].ToString() == "0")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
+                                                        state = Language.StringByID(MyInternationalizationString.close);
 
                                                     }
                                                     else if (status["Data1"].ToString() == "1")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.open);
+                                                        state = Language.StringByID(MyInternationalizationString.open);
 
                                                     }
                                                     else if (status["Data1"].ToString() == "2")
                                                     {
 
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.onoff);
+                                                        state = Language.StringByID(MyInternationalizationString.onoff);
                                                     }
                                                 }
 
@@ -750,7 +384,7 @@
                                         break;
                                     case DeviceType.Thermostat:
                                         {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/ac.png";
+                                            icon = "ZigeeLogic/ac.png";
 
                                             var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
                                             if (TaskList == null)
@@ -761,6 +395,7 @@
                                             bool ifclose = false;
                                             foreach (var status in TaskList)
                                             {
+
                                                 if (TaskList.Count == 1)
                                                 {
                                                     //鏁扮粍鍙湁涓�涓厓绱犺鏄庡綋鍓嶇┖璋冪姸鎬佷负鍏筹紱
@@ -772,7 +407,6 @@
                                                 {
                                                     ifclose = true;
                                                 }
-
                                                 if (status["TaskType"].ToString() == "5")
                                                 {
                                                     if (status["Data1"] == "3")
@@ -846,11 +480,11 @@
                                             }
                                             if (ifclose)
                                             {
-                                                devicestatus.Text = modetext + ";" + temperaturetext + "鈩�;" + speedtext;
+                                                state = modetext + ";" + temperaturetext + "鈩�;" + speedtext;
                                             }
                                             else
                                             {
-                                                devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
+                                                state = Language.StringByID(MyInternationalizationString.close);
 
                                             }
                                         }
@@ -863,7 +497,6 @@
                             break;
                         case 2:
                             {
-
                                 //鍦ㄦ湰鍦版煡鎵捐鍦烘櫙;
                                 var sceneinof = Common.Room.AllRoomSceneUIList.Find((obj) => { return obj.Id.ToString() == actions["DeviceAddr"].ToString(); });
                                 //鏈湴娌℃湁瀛樺湪;
@@ -871,7 +504,7 @@
                                 {
                                     //瀹炵幇鐩殑:鏄剧ず鍑烘潵璁╁彲浠ヨ嚜宸辨槸鍚﹀垹闄�
                                     sceneinof = new SceneUI();
-                                    #region -----
+                                    #region --------
                                     ////鍦ㄧ綉鍏虫煡鎵捐鍦烘櫙;
                                     ////鏍囪闂:缃戠粶璇锋眰锛屽瓨鍦ㄨ鍥惧姞杞藉揩鎱㈢殑闂锛�
                                     //sceneinof = await Send.GetScene(int.Parse(actions["DeviceAddr"].ToString()));
@@ -889,58 +522,47 @@
                                     #endregion
                                 }
 
-
-
-
-                                actionsIcon.UnSelectedImagePath = "ZigeeLogic/scene.png";
-                                ///璁惧鍚嶇ОButton
-                                var btndevicename = new Button
-                                {
-                                    Y = Application.GetRealHeight(20),
-                                    Height = Application.GetRealHeight(50),
-                                    Width = Application.GetRealWidth(500),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Text = sceneinof.Name,
-                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                                    TextSize = 14,
-                                };
-                                actionsrowLayout.AddChidren(btndevicename);
-
-                                ///鍖哄煙(鎴块棿)鍚嶇ОButton
-                                var btnregionname = new Button
-                                {
-                                    Y = btndevicename.Bottom + Application.GetRealHeight(10),
-                                    Width = Application.GetRealWidth(500),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Height = Application.GetRealHeight(50),
-                                    Text = "",//Language.StringByID(MyInternationalizationString.customroom),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                };
-                                actionsrowLayout.AddChidren(btnregionname);
+                                icon = "ZigeeLogic/scene.png";
+                                name = sceneinof.Name;
+                                actiondevice.regionNameBtn.Visible = true;
                                 /////閫氳繃璁惧鎵惧埌鍖哄煙(鎴块棿)鍚嶇О
                                 Common.Room room = new Common.Room();
-                                btnregionname.Text = room.GetRoomNameBySceneId(sceneinof.Id);
-                                //Send.RoomNmae(btnregionname, deviceinof);
-
-
+                                actiondevice.regionNameBtn.Text = room.GetRoomNameBySceneId(sceneinof.Id);
 
                             }
                             break;
-
                     }
-                    ///鍒犻櫎鎺т欢
-                    var del = new Button
-                    {
-                        BackgroundColor = ZigbeeColor.Current.LogicDelBlackColor1,
-                        Text = Language.StringByID(MyInternationalizationString.del),
-                    };
-                    actionsrowLayout.AddRightView(del);
 
-                    del.MouseUpEventHandler += (sender, e) =>
+                    //鐘舵��
+                    actiondevice.deviceNameBtn.Visible = true;
+                    actiondevice.deviceNameBtn.Text = name;
+                    actiondevice.iconBtn.UnSelectedImagePath = icon;
+                    actiondevice.selecetddevicestateBtn.Text = state;
+
+                    ///缂栬緫
+                    actiondevice.edit.MouseUpEventHandler += (sender, e) =>
                     {
+                        switch (linkType)
+                        {
+                            case 0:
+                                {
+                                    var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString());
+                                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
+                                    this.AddChidren(flMain);
+                                    CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "action_lockaction");
+                                }
+                                break;
+
+
+                        }
+                    };
+                    ///鍒犻櫎鎺т欢
+                    actiondevice.del.MouseUpEventHandler += (sender, e) =>
+                    {
+
                         var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
-           Language.StringByID(MyInternationalizationString.doyouwanttodelete),
-          Language.StringByID(MyInternationalizationString.confrim));
+                             Language.StringByID(MyInternationalizationString.doyouwanttodelete),
+                             Language.StringByID(MyInternationalizationString.confrim));
                         alert.Show();
 
                         alert.ConfirmClickEvent += () =>
@@ -951,7 +573,6 @@
                             UserView.HomePage.Instance.PageIndex += 1;
                             lockLogicCommunalPage.Show(() => { });
                         };
-
                     };
 
                 }
@@ -960,213 +581,19 @@
             #endregion
 
             #region  ----鎺ㄩ�佽缃�----
-
-            var fraline1 = new FrameLayout
-            {
-                Height = Application.GetRealHeight(30),
-            };
-            middle.AddChidren(fraline1);
-
-            var pushFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(pushFrameLayout);
-
-            var pushswitchRowlayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            pushFrameLayout.AddChidren(pushswitchRowlayout);
-
-            var btnswitchtxet = new Button
-            {
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(60),
-                Gravity = Gravity.CenterVertical,
-                TextID = MyInternationalizationString.pushswitch,
-                TextSize = 14,
-            };
-            pushswitchRowlayout.AddChidren(btnswitchtxet);
-
-            var btnswitch = new Button
-            {
-                Width = Application.GetMinRealAverage(104),
-                Height = Application.GetMinRealAverage(63),
-                UnSelectedImagePath = "ZigeeLogic/logicclose.png",
-                SelectedImagePath = "ZigeeLogic/logicopen.png",
-                X = Application.GetRealWidth(965 - 104),
-                Gravity = Gravity.CenterVertical,
-            };
-            pushswitchRowlayout.AddChidren(btnswitch);
-           
-
-            var custompushFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(0),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(custompushFrameLayout);
-
-            var custompushRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            custompushFrameLayout.AddChidren(custompushRowLayout);
-
-            var btncustompush = new Button
-            {
-                TextID = MyInternationalizationString.custompush,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(60),
-                Gravity = Gravity.CenterVertical,
-                TextSize = 14,
-            };
-            custompushRowLayout.AddChidren(btncustompush);
-
-
-            var custompushback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = Application.GetRealWidth(965 - 58),
-                Gravity = Gravity.CenterVertical,
-            };
-            custompushRowLayout.AddChidren(custompushback);
-            EventHandler<MouseEventArgs> customclick = (sender, e) =>
-            {
-                var CustomText = new CustomText();
-                UserView.HomePage.Instance.AddChidren(CustomText);
-                UserView.HomePage.Instance.PageIndex += 1;
-                CustomText.Show();
-
-            };
-            btncustompush.MouseUpEventHandler += customclick;
-            custompushback.MouseUpEventHandler += customclick;
-            custompushRowLayout.MouseUpEventHandler += customclick;
-
+            Method.Push(middle);
             #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,
-                Height = Application.GetRealHeight(180),
-                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-            };
-            this.AddChidren(saveFrameLayout);
-
-            var btnsave = new Button
-            {
-                X = Application.GetRealWidth(85),
-                Height = Application.GetRealHeight(130),//194
-                Width = Application.GetRealWidth(910),
-                Radius = (uint)Application.GetRealHeight(60),
-                BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
-                TextID = MyInternationalizationString.Save,
-                TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                TextSize = 16,
-            };
-            saveFrameLayout.AddChidren(btnsave);
-            btnsave.MouseUpEventHandler += async (sender, e) =>
-            {
-                var name = logicTextBox.Text.Trim();
-                if (string.IsNullOrEmpty(logicTextBox.Text.Trim()))
-                {
-                    var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
-            Language.StringByID(MyInternationalizationString.PleaseEnterLogicName),
-            Language.StringByID(MyInternationalizationString.confrim));
-                    alert.Show();
-                    return;
-                }
-                //var logicname = Common.Logic.LockLogicList.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;
-
-                //鍒ゆ柇鏄柊娣诲姞閫昏緫(榛樿0)杩樻槸淇敼閫昏緫
-                CommonPage.Loading.Start();
-                if (Common.Logic.CurrentLogic.LogicId == 0)
-                {
-                    //鍙戦�佹坊鍔犻�昏緫鍛戒护
-                    var logicifon = await Send.AddModifyLogic(Common.Logic.CurrentLogic);
-                    if (logicifon != null && logicifon.LogicId != 0)
-                    {
-                        Common.Logic.CurrentLogic.LogicId = logicifon.LogicId;
-                        Common.Logic.LockLogicList.Add(Common.Logic.CurrentLogic);
-                        if (tag)
-                        {
-                            Send.Zj(tag, Common.Logic.CurrentLogic);
-                        }
-                    }
-                }
-                else
-                {
-                    //鍙戦�佷慨鏀归�昏緫鍛戒护
-                    Send.AddModifyLogic(Common.Logic.CurrentLogic);
-                }
-
-                CommonPage.Loading.Hide();
-                UserView.HomePage.Instance.RemoveViewByTag("LockLogic");
-                UserView.HomePage.Instance.RemoveViewByTag("LockLogicList");
-                var doorLockLogicList = new LockLogicList();
-                UserView.HomePage.Instance.AddChidren(doorLockLogicList);
-                UserView.HomePage.Instance.PageIndex += 1;
-                doorLockLogicList.Show();
-            };
+       
+            saveBtn.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+           {
+               var name = logicTextBox.Text.Trim();
+               Method.SaveLogic(LogicView.IfString._LockLogic, name,LogicView.IfString.Tag, Common.Logic.CurrentLogic);
+           };
 
         }
         public  void AddCondition(int value)
         {
-            Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
             var addCondition = new AddCondition();
             addCondition.conditionsIndex = value;
             UserView.HomePage.Instance.AddChidren(addCondition);
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
index 3a326c6..642f04f 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
@@ -10,61 +10,17 @@
 
         public LockLogicList()
         {
-            Tag = "LockLogicList";
+            Tag = "Logic";
         }
         VerticalRefreshLayout middle;
         public void Show()
         {
 
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.linkageevent,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
+            #region  涓婇潰鐨勫竷灞�浠g爜
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.TextID = MyInternationalizationString.linkageevent;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
 
             var addiocn = new Button
             {
@@ -74,7 +30,7 @@
                 UnSelectedImagePath = "ZigeeLogic/lockadd.png",
                 Y = Application.GetRealHeight(184 - 72 - 20),
             };
-            topRowLayout.AddChidren(addiocn);
+            view.topRowLayout.AddChidren(addiocn);
             addiocn.MouseUpEventHandler += (sender, e) =>
             {
                 //new涓�涓柊閫昏緫瀵硅薄锛�
@@ -90,10 +46,9 @@
                 lockLogicCommunalPage.Show(() => { });
             };
             #endregion
-
             middle = new VerticalRefreshLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
@@ -152,7 +107,7 @@
         /// <summary>
         /// 鍔犺浇鑷姩鍖栧垪琛ㄧ殑鐣岄潰
         /// </summary>
-        public void Automationview() 
+        public void Automationview()
         {
             middle.RemoveAll();
 
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/EverymonthPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/EverymonthPage.cs
index d983614..871ad42 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/EverymonthPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/EverymonthPage.cs
@@ -18,59 +18,18 @@
         }
         public void Show(string titlename)
         {
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
+          
 
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                Text = titlename,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent();
-            };
+            #region  涓婇潰鐨勫竷灞�浠g爜
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.Text = titlename;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             #endregion
 
             var middle = new FrameLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs b/ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs
index 49c6e67..4e11f1f 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/IgnoreTime.cs
@@ -19,60 +19,16 @@
         public void Show(CommonDevice common, string name, bool edit, int timevalue)
         {
 
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                Text = name,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
+            #region  涓婇潰鐨勫竷灞�浠g爜
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.Text= name;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             #endregion
 
             var middle = new VerticalScrolViewLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184 - 260),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
index 1338506..4d09e94 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
@@ -4,6 +4,7 @@
 using Shared;
 using Shared.Common;
 using Shared.Phone;
+using Shared.Phone.Device.Logic.LogicView;
 using Shared.R;
 using ZigBee.Device;
 
@@ -20,94 +21,35 @@
         EditText logicTextBox;
         public async void Show(Action action)
         {
-            
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
 
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.selection,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
+            #region  View甯冨眬浠g爜
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
             if (Common.Logic.CurrentLogic.LogicId != 0)
             {
-                titleName.Text = Language.StringByID(MyInternationalizationString.editautomation);
+                view.toptitleNameBtn.Text = Language.StringByID(MyInternationalizationString.editautomation);
             }
             else
             {
-                titleName.Text = Language.StringByID(MyInternationalizationString.newautomation);
+                view.toptitleNameBtn.Text = Language.StringByID(MyInternationalizationString.newautomation);
             }
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
+            view.clickBtn.MouseDownEventHandler += (sender, e) =>
             {
                 action();
                 RemoveFromParent();
             };
-            #endregion
-
             var middle = new VerticalScrolViewLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184-180),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
-            var saveFrameLayout = new FrameLayout
-            {
-                Y = middle.Bottom,
-                Height = Application.GetRealHeight(180),
-                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-            };
-            this.AddChidren(saveFrameLayout);
-
-            var btnsave = new Button
-            {
-                X = Application.GetRealWidth(85),
-                Height = Application.GetRealHeight(130),//194
-                Width = Application.GetRealWidth(910),
-                Radius = (uint)Application.GetRealHeight(60),
-                BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
-                TextID = MyInternationalizationString.Save,
-                TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                TextSize = 16,
-            };
-            saveFrameLayout.AddChidren(btnsave);
+            var saveBtn = new SaveView();
+            saveBtn.frameLayout.Y = middle.Bottom;
+            saveBtn.frameLayout.Height = Application.GetRealHeight(180);
+            this.AddChidren(saveBtn.Show());
+            #endregion
 
             #region -----鑷姩鍖栧悕绉� 璁剧疆鍚嶇О-----
             var logicnamefl = new FrameLayout
@@ -153,63 +95,13 @@
             #endregion
 
             #region -----鏄剧ず閫昏緫鏉′欢-----
+            Addview addconditionview = new Addview();
+            addconditionview.iconBtn.Visible = true;
+            addconditionview.titleBtn.TextID = MyInternationalizationString.ifcondition;
+            middle.AddChidren(addconditionview.AddDeviceView());
 
-
-            var conditionFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(conditionFrameLayout);
-
-
-            var conditionRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            conditionFrameLayout.AddChidren(conditionRowLayout);
-
-
-            conditionRowLayout.AddChidren(new Button
-            {
-
-                Text = Language.StringByID(MyInternationalizationString.ifcondition),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(60),
-                TextSize = 15,
-                Gravity = Gravity.CenterVertical,
-            });
-
-            var conditionadd1 = new Button
-            {
-
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(57),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(965 + 58),
-
-            };
-            conditionFrameLayout.AddChidren(conditionadd1);
-
-            var conditionadd = new Button
-            {
-
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/add.png",
-                X = Application.GetRealWidth(965 - 58),
-                Gravity = Gravity.CenterVertical,
-
-            };
-            conditionRowLayout.AddChidren(conditionadd);
             ///娣诲姞鏉′欢鐨勭偣鍑讳簨浠�
-            EventHandler<MouseEventArgs> conditionaddclick = (sender, e) =>
+            addconditionview.clickBtn.MouseUpEventHandler+= (sender, e) =>
             {
                 if (Common.Logic.CurrentLogic.Conditions.Count == 1)
                 {
@@ -223,8 +115,6 @@
                     addLogicPage.Show();
                 }
             };
-            conditionadd.MouseUpEventHandler += conditionaddclick;
-            conditionadd1.MouseUpEventHandler += conditionaddclick;
             List<Dictionary<string, string>> ListConditions = new List<Dictionary<string, string>>();
             ListConditions.Clear();
             ListConditions.AddRange(Common.Logic.CurrentLogic.Conditions);
@@ -267,37 +157,10 @@
             {
                 if (i == (ListConditions.Count - 1))
                 {
-
-                    var addfl = new FrameLayout
-                    {
-                        Height = Application.GetRealHeight(160 + 30 + 50),
-                        BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    };
-                    middle.AddChidren(addfl);
-                    var addbtn = new Button
-                    {
-                        Height = Application.GetRealHeight(130 + 50),
-                        Width = Application.GetRealWidth(908),
-                        Y = Application.GetRealHeight(30),
-                        X = Application.GetRealWidth(86),
-                        UnSelectedImagePath = "ZigeeLogic/logicaddcolor.png",
-                    };
-                    addfl.AddChidren(addbtn);
-
-
-                    var addtextbtn = new Button
-                    {
-                        Height = Application.GetRealHeight(58),
-                        Width = Application.GetRealWidth(300),
-                        Y = Application.GetRealHeight(45 + 30),
-                        TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                        TextID = MyInternationalizationString.addconditions,
-                        X = Application.GetRealWidth(390),
-                        TextSize = 14,
-                    };
-                    addfl.AddChidren(addtextbtn);
-
-                    EventHandler<MouseEventArgs> addconditionsclick = (sender, e) =>
+                    LogicView.AddDeviceView addflview = new LogicView.AddDeviceView();
+                    addflview.titleBtn.TextID = MyInternationalizationString.addconditions;
+                    middle.AddChidren(addflview.AddFl());
+                    addflview.clickBtn.MouseUpEventHandler += (sender, e) =>
                     {
                         if (Common.Logic.CurrentLogic.Conditions.Count == 1)
                         {
@@ -311,308 +174,127 @@
                             addLogicPage.Show();
                         }
                     };
-                    addbtn.MouseUpEventHandler += addconditionsclick;
-                    addtextbtn.MouseUpEventHandler += addconditionsclick;
                 }
                 else
                 {
-                    var devicesFrameLayout = new FrameLayout
-                    {
-                        Height = Application.GetRealHeight(130),
-                        BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    };
-                    middle.AddChidren(devicesFrameLayout);
-
-                    ///鏄剧ず鍥炬爣
-                    var conditionIcon = new Button
-                    {
-                        Width = Application.GetRealWidth(81),
-                        Height = Application.GetRealHeight(81),
-                        X = Application.GetRealWidth(104),
-                        Y = Application.GetRealHeight(25),
-                        //UnSelectedImagePath = "ZigeeLogic/time.png",
-
-                    };
-                    devicesFrameLayout.AddChidren(conditionIcon);
-
-
-                    var conditionsRowLayout = new RowLayout
-                    {
-                        Width = Application.GetRealWidth(800),
-                        Height = Application.GetRealHeight(130),
-                        X = Application.GetRealWidth(222),
-                        LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                    };
-                    devicesFrameLayout.AddChidren(conditionsRowLayout);
-
+                    SelectedDeviceView selecteddevice = new SelectedDeviceView();
+                    selecteddevice.Show(middle);
                     var Type = int.Parse(ListConditions[i]["Type"]);
                     var conditions = ListConditions[i];
+                    string name = "";
+                    string icon = "";
+                    string state = "";
                     switch (Type)
                     {
-
                         /// (0:鏃堕棿鐐规潯浠�;1:璁惧鐘舵�佸彉鍖栨潯浠�;2:鍏朵粬閫昏緫鏉′欢;3:璁℃暟鍣ㄦ潯浠�;4:鍊掕鏃�;5:鏃堕棿娈垫潯浠�;6:瀹夐槻鏉′欢;7:鍦扮悊浣嶇疆)
                         case 0:
                             {
-                                ///鏄剧ず鏃堕棿
-                                var timevalue = new Button
-                                {
-                                    Width = Application.GetRealWidth(200),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Gravity = Gravity.CenterVertical,
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    TextSize = 14,
-                                };
-                                conditionsRowLayout.AddChidren(timevalue);
-
-
-                                var timeTxet = new Button
-                                {
-                                    Width = Application.GetRealWidth(400),
-                                    TextAlignment = TextAlignment.CenterRight,
-                                    Gravity = Gravity.CenterVertical,
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    X = conditionsRowLayout.Width - Application.GetRealWidth(400),
-                                    TextSize = 14,
-                                };
-                                conditionsRowLayout.AddChidren(timeTxet);
-
-
-                                var timeedit = new Button
-                                {
-                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
-                                    Text = Language.StringByID(MyInternationalizationString.edit),
-                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                                };
-                                conditionsRowLayout.AddRightView(timeedit);
-
-                                timeedit.MouseUpEventHandler += (sender, e) =>
-                                {
-                                    var timePoint = new TimePoint();
-                                    UserView.HomePage.Instance.AddChidren(timePoint);
-                                    UserView.HomePage.Instance.PageIndex += 1;
-                                    timePoint.IsEditor = true;
-                                    timePoint.Show(conditions);
-                                };
 
                                 //"0姝e父鏃堕棿鐐�","1鏃ュ嚭鏃堕棿","2鏃ヨ惤鏃堕棿","3姝e崍鏃堕棿"
                                 switch (int.Parse(conditions["DateType"]))
                                 {
                                     case 0:
                                         {
+                                            name = Language.StringByID(MyInternationalizationString.immediateexecution);
+                                            icon = "ZigeeLogic/timepoint.png";
                                             string s = "";
                                             s = conditions["StartMin"].Length < 2 ? "0" + conditions["StartMin"] : conditions["StartMin"];
-                                            timevalue.Text = conditions["StartHour"] + ":" + s;
-                                            timeTxet.TextID = MyInternationalizationString.immediateexecution;
-                                            conditionIcon.UnSelectedImagePath = "ZigeeLogic/timepoint.png";
+                                            state = conditions["StartHour"] + ":" + s;
+                                            
                                         }
                                         break;
                                     case 1:
-                                        timevalue.TextID = MyInternationalizationString.sunrise;
-                                        conditionIcon.UnSelectedImagePath = "ZigeeLogic/sunrise.png";
-                                        if (int.Parse(conditions["AdjustTime"]) > 0)
                                         {
-                                            timeTxet.Text = Language.StringByID(MyInternationalizationString.delayed) + conditions["AdjustTime"] + Language.StringByID(MyInternationalizationString.logicminute);
-                                        }
-                                        else if (int.Parse(conditions["AdjustTime"]) < 0)
-                                        {
-                                            timeTxet.Text = Language.StringByID(MyInternationalizationString.advance) + Math.Abs(int.Parse(conditions["AdjustTime"])).ToString() + Language.StringByID(MyInternationalizationString.logicminute);
-                                        }
-                                        else
-                                        {
-                                            //timeTxet.Text = Language.StringByID(MyInternationalizationString.sunrise);
+                                            name = Language.StringByID(MyInternationalizationString.sunrise);
+                                            icon = "ZigeeLogic/sunrise.png";
+                                            if (int.Parse(conditions["AdjustTime"]) > 0)
+                                            {
+                                                state = Language.StringByID(MyInternationalizationString.delayed) + conditions["AdjustTime"] + Language.StringByID(MyInternationalizationString.logicminute);
+                                            }
+                                            else if (int.Parse(conditions["AdjustTime"]) < 0)
+                                            {
+                                                state = Language.StringByID(MyInternationalizationString.advance) + Math.Abs(int.Parse(conditions["AdjustTime"])).ToString() + Language.StringByID(MyInternationalizationString.logicminute);
+                                            }
+                                            else
+                                            {
+                                                //timeTxet.Text = Language.StringByID(MyInternationalizationString.sunrise);
+                                            }
                                         }
                                         break;
                                     case 2:
-                                        timevalue.TextID = MyInternationalizationString.sunset;
-                                        conditionIcon.UnSelectedImagePath = "ZigeeLogic/sunset.png";
-                                        if (int.Parse(conditions["AdjustTime"]) > 0)
                                         {
-                                            timeTxet.Text = Language.StringByID(MyInternationalizationString.delayed) + conditions["AdjustTime"] + Language.StringByID(MyInternationalizationString.logicminute);
-                                        }
-                                        else if (int.Parse(conditions["AdjustTime"]) < 0)
-                                        {
-                                            timeTxet.Text = Language.StringByID(MyInternationalizationString.advance) + Math.Abs(int.Parse(conditions["AdjustTime"])).ToString() + Language.StringByID(MyInternationalizationString.logicminute);
-                                        }
-                                        else
-                                        {
-                                            // timevalue.Text = Language.StringByID(MyInternationalizationString.sunset);
+                                            name = Language.StringByID(MyInternationalizationString.sunset);
+                                            icon = "ZigeeLogic/sunset.png";
+                                            if (int.Parse(conditions["AdjustTime"]) > 0)
+                                            {
+                                                state = Language.StringByID(MyInternationalizationString.delayed) + conditions["AdjustTime"] + Language.StringByID(MyInternationalizationString.logicminute);
+                                            }
+                                            else if (int.Parse(conditions["AdjustTime"]) < 0)
+                                            {
+                                                state = Language.StringByID(MyInternationalizationString.advance) + Math.Abs(int.Parse(conditions["AdjustTime"])).ToString() + Language.StringByID(MyInternationalizationString.logicminute);
+                                            }
+                                            else
+                                            {
+                                                // timevalue.Text = Language.StringByID(MyInternationalizationString.sunset);
+                                            }
                                         }
                                         break;
                                     case 3:
-                                        timevalue.TextID = MyInternationalizationString.noon;
-                                        conditionIcon.UnSelectedImagePath = "ZigeeLogic/noon.png";
-                                        if (int.Parse(conditions["AdjustTime"]) > 0)
                                         {
-                                            timeTxet.Text = Language.StringByID(MyInternationalizationString.delayed) + conditions["AdjustTime"] + Language.StringByID(MyInternationalizationString.logicminute);
-                                        }
-                                        else if (int.Parse(conditions["AdjustTime"]) < 0)
-                                        {
-                                            timeTxet.Text = Language.StringByID(MyInternationalizationString.advance) + Math.Abs(int.Parse(conditions["AdjustTime"])).ToString() + Language.StringByID(MyInternationalizationString.logicminute);
-                                        }
-                                        else
-                                        {
-                                            // timeTxet.Text = Language.StringByID(MyInternationalizationString.noon);
+                                            name = Language.StringByID(MyInternationalizationString.noon);
+                                            icon = "ZigeeLogic/noon.png";
+                                            if (int.Parse(conditions["AdjustTime"]) > 0)
+                                            {
+                                                state = Language.StringByID(MyInternationalizationString.delayed) + conditions["AdjustTime"] + Language.StringByID(MyInternationalizationString.logicminute);
+                                            }
+                                            else if (int.Parse(conditions["AdjustTime"]) < 0)
+                                            {
+                                                state = Language.StringByID(MyInternationalizationString.advance) + Math.Abs(int.Parse(conditions["AdjustTime"])).ToString() + Language.StringByID(MyInternationalizationString.logicminute);
+                                            }
+                                            else
+                                            {
+                                                // timeTxet.Text = Language.StringByID(MyInternationalizationString.noon);
+                                            }
                                         }
                                         break;
                                 }
-
+                          
                             }
                             break;
                         case 5:
                             {
-                                conditionIcon.UnSelectedImagePath = "ZigeeLogic/timeparagraph.png";
+                                icon = "ZigeeLogic/timeparagraph.png";
                                 string s1 = "", s2 = "";
                                 s1 = conditions["StartMin"].Length < 2 ? "0" + conditions["StartMin"] : conditions["StartMin"];
                                 s2 = conditions["StopMin"].Length < 2 ? "0" + conditions["StopMin"] : conditions["StopMin"];
                                 ///鏄剧ず鏃堕棿
-                                var timevalue = new Button
-                                {
-                                    Width = Application.GetRealWidth(400),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Gravity = Gravity.CenterVertical,
-                                    Text = conditions["StartHour"] + ":" + s1 + "-" + conditions["StopHour"] + ":" + s2,
-                                    //TextColor = 0xff121212,
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    TextSize = 14,
-                                };
-                                conditionsRowLayout.AddChidren(timevalue);
-                                var timeTxet = new Button
-                                {
-                                    Width = Application.GetRealWidth(400),
-                                    TextAlignment = TextAlignment.CenterRight,
-                                    Gravity = Gravity.CenterVertical,
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    X = conditionsRowLayout.Width - Application.GetRealWidth(400),
-                                    TextID = MyInternationalizationString.timeframe,
-                                    TextSize = 14,
-                                };
-                                conditionsRowLayout.AddChidren(timeTxet);
-
-                                var timeedit = new Button
-                                {
-                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
-                                    Text = Language.StringByID(MyInternationalizationString.edit),
-                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                                };
-                                conditionsRowLayout.AddRightView(timeedit);
-                                timeedit.MouseUpEventHandler += (sender, e) =>
-                                {
-                                    var timePage = new TimePage();
-                                    UserView.HomePage.Instance.AddChidren(timePage);
-                                    UserView.HomePage.Instance.PageIndex += 1;
-                                    timePage.str1 = conditions["StartHour"] + ":" + conditions["StartMin"] + "-" + conditions["StopHour"] + ":" + conditions["StopMin"];
-                                    timePage.IsEditor = true;
-                                    timePage.Show();
-                                };
+                                name = conditions["StartHour"] + ":" + s1 + "-" + conditions["StopHour"] + ":" + s2;
+                                state =Language.StringByID(MyInternationalizationString.timeframe);
                             }
                             break;
                         case 1:
                             {
-                                var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return obj.DeviceAddr == conditions["MacAddr"] && obj.DeviceEpoint.ToString() == conditions["Epoint"]; });
-                                if (deviceinof == null)
-                                {
-                                    deviceinof = new ZigBee.Device.CommonDevice();
-                                    //continue;
-                                }
-                                ///鏄剧ず璁惧鍚嶇О
-                                var btndevice = new Button
-                                {
-                                    Y = Application.GetRealHeight(20),
-                                    Height = Application.GetRealHeight(50),
-                                    Width = Application.GetRealWidth(400),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Text = deviceinof.DeviceEpointName,
-                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                                    TextSize = 14,
-                                };
-                                conditionsRowLayout.AddChidren(btndevice);
-
-                                ///鍖哄煙(鎴块棿)鍚嶇ОButton
-                                var btnregionname = new Button
-                                {
-                                    Y = btndevice.Bottom + Application.GetRealHeight(10),
-                                    Width = Application.GetRealWidth(400),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Height = Application.GetRealHeight(50),
-                                    Text = "",//Language.StringByID(MyInternationalizationString.customroom),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                };
-                                conditionsRowLayout.AddChidren(btnregionname);
-                                ///閫氳繃璁惧鎵惧埌鍖哄煙(鎴块棿)鍚嶇О
-                                Send.RoomNmae(btnregionname, deviceinof);
-
-
-                                var deviceedit = new Button
-                                {
-                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
-                                    Text = Language.StringByID(MyInternationalizationString.edit),
-                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                                };
-                                conditionsRowLayout.AddRightView(deviceedit);
-                                deviceedit.MouseUpEventHandler += (sender, e) =>
-                                {
-
-                                    if (deviceinof.Type != DeviceType.DoorLock)
-                                    {
-                                        var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                                        this.AddChidren(flMain);
-                                        DeviceStateCondition.CurrentDeviceView(flMain, deviceinof, true);
-                                    }
-                                    else
-                                    {
-                                        var memberList = new MemberList();
-                                        UserView.HomePage.Instance.AddChidren(memberList);
-                                        UserView.HomePage.Instance.PageIndex += 1;
-                                        MemberList.edit = true;
-                                        memberList.Show(deviceinof, conditions);
-                                    }
-
-                                };
-
-                                ///鏄剧ず璁惧鏉′欢鐘舵�佹帶浠�
-                                var devicestatus = new Button
-                                {
-                                    Width = Application.GetRealWidth(400),
-                                    Height = Application.GetRealHeight(130),
-                                    Gravity = Gravity.CenterVertical,
-                                    TextAlignment = TextAlignment.CenterRight,
-                                    X = Application.GetRealWidth(400),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    TextSize = 14,
-                                };
-                                conditionsRowLayout.AddChidren(devicestatus);
+                                var deviceinof = Method.GetCommonDevice(conditions["MacAddr"], conditions["Epoint"]);
+                                name = deviceinof.DeviceEpointName;
+                                selecteddevice.regionNameBtn.Visible = true;
+                                Method.RoomNmae(selecteddevice.regionNameBtn, deviceinof);
 
                                 switch (deviceinof.Type)
                                 {
                                     case DeviceType.OnOffOutput:
                                         {
-                                            conditionIcon.UnSelectedImagePath = "ZigeeLogic/light.png";
+                                            icon = "ZigeeLogic/light.png";
                                             if (conditions["AttriButeId"] == "0")
                                             {
                                                 if (conditions["AttriButeData1"] == "1")
                                                 {
-                                                    devicestatus.Text = Language.StringByID(MyInternationalizationString.open);
+                                                    state = Language.StringByID(MyInternationalizationString.open);
                                                 }
                                                 else
                                                 {
-                                                    devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
+                                                    state = Language.StringByID(MyInternationalizationString.close);
                                                 }
 
-                                            }
-                                        }
-                                        break;
-                                    case DeviceType.WindowCoveringDevice:
-                                        {
-                                            if (conditions["AttriButeId"] == "8")//鏈夋涔夛紝娌℃湁寮�鍏冲睘鎬d锛�
-                                            {
-                                                if (int.Parse(conditions["AttriButeData1"]) > 5)
-                                                {
-                                                    devicestatus.Text = Language.StringByID(MyInternationalizationString.open);
-                                                }
-                                                else
-                                                {
-                                                    devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
-                                                }
                                             }
                                         }
                                         break;
@@ -620,14 +302,14 @@
                                         {
                                             var iASZonedevice = deviceinof as IASZone;
                                             var intvalue = conditions["AttriButeData1"];
-                                            conditionIcon.UnSelectedImagePath = $"ZigeeLogic/sensor{iASZonedevice.IasDeviceType}.png";
+                                            icon = $"ZigeeLogic/sensor{iASZonedevice.IasDeviceType}.png";
                                             switch (iASZonedevice.IasDeviceType)
                                             {
                                                 case 13:
                                                     {
                                                         if (intvalue == "1")
                                                         {
-                                                            devicestatus.TextID = MyInternationalizationString.someone;
+                                                            state=Language.StringByID( MyInternationalizationString.someone);
                                                         }
                                                         else
                                                         {
@@ -635,19 +317,19 @@
                                                             int second = int.Parse(conditions["IgnoreTime"]) % 60;
                                                             if (minute != 0 && second != 0)
                                                             {
-                                                                devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1);
+                                                                state = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1);
 
                                                             }
                                                             else
                                                             {
                                                                 if (minute == 0 && second != 0)
                                                                 {
-                                                                    devicestatus.Text = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1);
+                                                                    state = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1);
 
                                                                 }
                                                                 if (minute != 0 && second == 0)
                                                                 {
-                                                                    devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1);
+                                                                    state = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1);
 
                                                                 }
 
@@ -660,7 +342,7 @@
                                                     {
                                                         if (intvalue == "1")
                                                         {
-                                                            devicestatus.TextID = MyInternationalizationString.logicopen;
+                                                            state =Language.StringByID( MyInternationalizationString.logicopen);
                                                         }
                                                         else
                                                         {
@@ -671,19 +353,19 @@
                                                                 int second = int.Parse(conditions["IgnoreTime"]) % 60;
                                                                 if (minute != 0 && second != 0)
                                                                 {
-                                                                    devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime);
+                                                                    state = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime);
 
                                                                 }
                                                                 else
                                                                 {
                                                                     if (minute == 0 && second != 0)
                                                                     {
-                                                                        devicestatus.Text = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime);
+                                                                        state = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.closetime);
 
                                                                     }
                                                                     if (minute != 0 && second == 0)
                                                                     {
-                                                                        devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.closetime);
+                                                                        state = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.closetime);
 
                                                                     }
 
@@ -692,7 +374,7 @@
                                                             }
                                                             else
                                                             {
-                                                                devicestatus.TextID = MyInternationalizationString.logicclose;
+                                                                state =Language.StringByID(MyInternationalizationString.logicclose);
                                                             }
                                                         }
                                                     }
@@ -701,7 +383,7 @@
                                                     {
                                                         if (intvalue == "1")
                                                         {
-                                                            devicestatus.TextID = MyInternationalizationString.smokescreen;
+                                                            state =Language.StringByID(MyInternationalizationString.smokescreen);
                                                         }
 
                                                     }
@@ -710,11 +392,11 @@
                                                     {
                                                         if (intvalue == "1")
                                                         {
-                                                            devicestatus.TextID = MyInternationalizationString.waterleakage;
+                                                            state =Language.StringByID( MyInternationalizationString.waterleakage);
                                                         }
                                                         else
                                                         {
-                                                            devicestatus.TextID = MyInternationalizationString.noleakage;
+                                                            state =Language.StringByID( MyInternationalizationString.noleakage);
                                                         }
                                                     }
                                                     break;
@@ -722,7 +404,7 @@
                                                     {
                                                         if (intvalue == "1")
                                                         {
-                                                            devicestatus.TextID = MyInternationalizationString.gas;
+                                                            state =Language.StringByID( MyInternationalizationString.gas);
                                                         }
 
                                                     }
@@ -731,7 +413,7 @@
                                                     {
                                                         if (intvalue == "1")
                                                         {
-                                                            devicestatus.TextID = MyInternationalizationString.callthepolice;
+                                                            state =Language.StringByID( MyInternationalizationString.callthepolice);
                                                         }
 
                                                     }
@@ -740,7 +422,7 @@
                                                     {
                                                         if (intvalue == "1")
                                                         {
-                                                            devicestatus.TextID = MyInternationalizationString.callthepolice;
+                                                            state =Language.StringByID(MyInternationalizationString.callthepolice);
                                                         }
                                                     }
                                                     break;
@@ -750,20 +432,20 @@
                                         break;
                                     case DeviceType.OnOffSwitch:
                                         {
-                                            conditionIcon.UnSelectedImagePath = "ZigeeLogic/panel.png";
-                                            devicestatus.Text = Language.StringByID(MyInternationalizationString.OnOffSwitch) + conditions["Epoint"];
+                                            icon = "ZigeeLogic/panel.png";
+                                            state = Language.StringByID(MyInternationalizationString.OnOffSwitch) + conditions["Epoint"];
                                         }
                                         break;
                                     case DeviceType.DoorLock:
                                         {
-                                            conditionIcon.UnSelectedImagePath = "ZigeeLogic/doorlock.png";
+                                            icon = "ZigeeLogic/doorlock.png";
                                             for (int a = 0; a < Common.Logic.CurrentLogic.Accounts.Count; a++)
                                             {
                                                 if (Common.Logic.CurrentLogic.Accounts[a]["Type"] == "1")
                                                 {
                                                     if (Common.Logic.CurrentLogic.Accounts[a]["UserId"] == conditions["AttriButeData2"])
                                                     {
-                                                        devicestatus.Text = Common.Logic.CurrentLogic.Accounts[a]["AccountName"];
+                                                        state = Common.Logic.CurrentLogic.Accounts[a]["Account"];
                                                         break;
 
                                                     }
@@ -773,271 +455,196 @@
                                         }
                                         break;
                                     case DeviceType.TemperatureSensor:
-                                        // conditionIcon.UnSelectedImagePath = "ZigeeLogic/temperature.png";
-                                        var dev = deviceinof as TemperatureSensor;
-                                        if (conditions["Cluster_ID"] == "1026")
                                         {
-                                            dev.SensorDiv = 1;
+                                            // conditionIcon.UnSelectedImagePath = "ZigeeLogic/temperature.png";
+                                            var dev = deviceinof as TemperatureSensor;
+                                            if (conditions["Cluster_ID"] == "1026")
+                                            {
+                                                dev.SensorDiv = 1;
+                                            }
+                                            else
+                                            {
+                                                dev.SensorDiv = 2;
+                                            }
+                                            string s = "";
+                                            switch (conditions["Range"])
+                                            {
+                                                case "0":
+                                                    {
+                                                        s = ">";
+                                                    }
+                                                    break;
+                                                case "1":
+                                                    {
+                                                        s = "=";
+                                                    }
+                                                    break;
+                                                case "2":
+                                                    {
+                                                        s = "<";
+                                                    }
+                                                    break;
+                                                case "6":
+                                                    {
+                                                        s = "鈮�";
+                                                    }
+                                                    break;
+                                                case "7":
+                                                    {
+                                                        s = "鈮�";
+                                                    }
+                                                    break;
+                                            }
+                                            if (conditions["Cluster_ID"] == "1026")
+                                            {
+                                                icon = "ZigeeLogic/temperature.png";
+                                                state = s + conditions["AttriButeData1"] + "鈩�";
+                                            }
+                                            else
+                                            {
+                                                icon = "ZigeeLogic/humidity.png";
+                                                state = s + conditions["AttriButeData1"] + "%";
+                                            }
+                                            break;
+
                                         }
-                                        else
-                                        {
-                                            dev.SensorDiv = 2;
-                                        }
-                                        string s = "";
-                                        switch (conditions["Range"])
-                                        {
-                                            case "0":
-                                                {
-                                                    s = ">";
-                                                }
-                                                break;
-                                            case "1":
-                                                {
-                                                    s = "=";
-                                                }
-                                                break;
-                                            case "2":
-                                                {
-                                                    s = "<";
-                                                }
-                                                break;
-                                            case "6":
-                                                {
-                                                    s = "鈮�";
-                                                }
-                                                break;
-                                            case "7":
-                                                {
-                                                    s = "鈮�";
-                                                }
-                                                break;
-                                        }
-                                        if (conditions["Cluster_ID"] == "1026")
-                                        {
-                                            conditionIcon.UnSelectedImagePath = "ZigeeLogic/temperature.png";
-                                            devicestatus.Text = s + conditions["AttriButeData1"] + "鈩�";
-                                        }
-                                        else
-                                        {
-                                            conditionIcon.UnSelectedImagePath = "ZigeeLogic/humidity.png";
-                                            devicestatus.Text = s + conditions["AttriButeData1"] + "%";
-                                        }
-                                        break;
 
-                                }
-
-                            }
-                            break;
-                        case 2:
-                            {
-                                var logicinof = Common.Logic.LogicList.Find((obj) => { return obj.LogicId.ToString() == conditions["Condition_LogicId"]; });
-                                if (logicinof == null)
-                                {
-                                    continue;
-                                }
-                                ///鏄剧ず閫昏緫鍚嶇О
-                                var btnlogic = new Button
-                                {
-                                    Width = Application.GetRealWidth(700),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Gravity = Gravity.CenterVertical,
-                                    Text = logicinof.LogicName,
-                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                                    TextSize = 14,
-                                    //TextColor = 0xff121212,
-                                };
-                                conditionsRowLayout.AddChidren(btnlogic);
-
-
-                                var logicedit = new Button
-                                {
-                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
-                                    Text = Language.StringByID(MyInternationalizationString.edit),
-                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                                };
-                                conditionsRowLayout.AddRightView(logicedit);
-                                logicedit.MouseUpEventHandler += (sender, e) =>
-                                {
-                                    var selectedLogicStatus = new SelectedLogicStatus();
-                                    UserView.HomePage.Instance.AddChidren(selectedLogicStatus);
-                                    UserView.HomePage.Instance.PageIndex += 1;
-                                    selectedLogicStatus.IsDeviceEditor = true;
-                                    selectedLogicStatus.Show(logicinof);
-                                };
-
-                                ///鏄剧ずLogic鏉′欢鐘舵�佹帶浠�
-                                var logicstatus = new Button
-                                {
-                                    Width = Application.GetRealWidth(300),
-                                    Height = Application.GetRealHeight(130),
-                                    Gravity = Gravity.CenterVertical,
-                                    TextAlignment = TextAlignment.CenterRight,
-                                    X = Application.GetRealWidth(500),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    TextSize = 14,
-                                };
-                                conditionsRowLayout.AddChidren(logicstatus);
-
-                                if (conditions["IsValid"] == "1")
-                                {
-                                    logicstatus.Text = Language.StringByID(MyInternationalizationString.open1);
-                                }
-                                else
-                                {
-                                    logicstatus.Text = Language.StringByID(MyInternationalizationString.disable);
                                 }
                             }
                             break;
                         case 6:
                             {
-                                var btnsecurity = new Button
-                                {
-                                    Width = Application.GetRealWidth(700),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Gravity = Gravity.CenterVertical,
-                                    //Text = "瀹夐槻",
-                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                                    //TextColor = 0xff121212,
-                                    TextID = MyInternationalizationString.security,
-                                    TextSize = 14,
-                                };
-                                //conditionsRowLayout.AddChidren(btnsecurity);
-
-
-                                var btnsecurityedit = new Button
-                                {
-                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
-                                    Text = Language.StringByID(MyInternationalizationString.edit),
-                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                                };
-                                conditionsRowLayout.AddRightView(btnsecurityedit);
-                                btnsecurityedit.MouseUpEventHandler += (sender, e) =>
-                                {
-                                    //var securityPage = new SecurityPage();
-                                    //UserView.HomePage.Instance.AddChidren(securityPage);
-                                    //UserView.HomePage.Instance.PageIndex += 1;
-                                    //securityPage.IsDeviceEditor = true;
-                                    //securityPage.Show();
-
-                                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                                    this.AddChidren(flMain);
-                                    AddLogicPage.SecurityView(flMain, true);
-                                };
-
-                                ///鏄剧ず瀹夐槻鏉′欢鐘舵�佹帶浠�
-                                var securitystatus = new Button
-                                {
-                                    Width = Application.GetRealWidth(500),
-                                    Height = Application.GetRealHeight(130),
-                                    Gravity = Gravity.CenterVertical,
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    TextSize = 14,
-                                };
-                                conditionsRowLayout.AddChidren(securitystatus);
-
                                 switch (conditions["EnOrWithdrawMode"])
                                 {
                                     case "0":
                                         {
                                             if (conditions["ModeId"] == "1")
                                             {
-                                                conditionIcon.UnSelectedImagePath = "ZigeeLogic/athome.png";
-                                                securitystatus.Text = Language.StringByID(MyInternationalizationString.logicathomegarrison);
+                                                icon = "ZigeeLogic/athome.png";
+                                                name = Language.StringByID(MyInternationalizationString.logicathomegarrison);
 
                                             }
                                             else
                                             {
-                                                conditionIcon.UnSelectedImagePath = "ZigeeLogic/leavehome.png";
-                                                securitystatus.Text = Language.StringByID(MyInternationalizationString.logicremovehomegarrison);
+                                                icon = "ZigeeLogic/leavehome.png";
+                                                name = Language.StringByID(MyInternationalizationString.logicremovehomegarrison);
                                             }
                                         }
                                         break;
                                     case "1":
                                         {
-                                            conditionIcon.UnSelectedImagePath = "ZigeeLogic/withdrawal.png";
-                                            securitystatus.Text = Language.StringByID(MyInternationalizationString.withdrawal);
+                                            icon = "ZigeeLogic/withdrawal.png";
+                                            name = Language.StringByID(MyInternationalizationString.withdrawal);
                                         }
                                         break;
                                     case "2":
                                         {
-                                            conditionIcon.UnSelectedImagePath = "ZigeeLogic/withdrawal.png";
-                                            securitystatus.Text = Language.StringByID(MyInternationalizationString.urgentwithdrawal);
+                                            icon = "ZigeeLogic/withdrawal.png";
+                                            name = Language.StringByID(MyInternationalizationString.urgentwithdrawal);
                                         }
                                         break;
                                 }
-
                             }
                             break;
                         case 7:
                             {
-                                
-                                conditionIcon.UnSelectedImagePath = "ZigeeLogic/position.png";
-                                var btnlocation = new Button
-                                {
-                                    Width = Application.GetRealWidth(250),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Gravity = Gravity.CenterVertical,
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    TextID = MyInternationalizationString.geographicalposition,
-                                    TextSize = 14,
-                                };
-                                conditionsRowLayout.AddChidren(btnlocation);
-
-
-                                var btnlocationedit = new Button
-                                {
-                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
-                                    Text = Language.StringByID(MyInternationalizationString.edit),
-                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                                };
-                                conditionsRowLayout.AddRightView(btnlocationedit);
-                                btnlocationedit.MouseUpEventHandler += (sender, e) =>
-                                {
-
-                                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                                    this.AddChidren(flMain);
-                                    AddLogicPage.LocationView(flMain, true);
-                                };
-
-                                var locationstatus = new Button
-                                {
-                                    Width = Application.GetRealWidth(550),
-                                    Height = Application.GetRealHeight(130),
-                                    Gravity = Gravity.CenterVertical,
-                                    TextAlignment = TextAlignment.CenterRight,
-                                    X = Application.GetRealWidth(250),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    TextSize = 14,
-                                };
-                                conditionsRowLayout.AddChidren(locationstatus);
+                                icon = "ZigeeLogic/position.png";
+                                name = Language.StringByID(MyInternationalizationString.geographicalposition);
                                 foreach (var radius in Common.Logic.CurrentLogic.Accounts)
                                 {
                                     if (radius["Type"] == "7")
                                     {
                                         if (conditions["AtHome"] == "1")
                                         {
-                                            locationstatus.Text = Language.StringByID(MyInternationalizationString.athome) + radius["Radius"] + "绫�";
+                                            state = Language.StringByID(MyInternationalizationString.athome) + radius["Radius"] + "绫�";
                                         }
                                         else
                                         {
-                                            locationstatus.Text = Language.StringByID(MyInternationalizationString.leavehome) + radius["Radius"] + "绫�";
+                                            state = Language.StringByID(MyInternationalizationString.leavehome) + radius["Radius"] + "绫�";
                                         }
                                     }
                                 }
                             }
                             break;
-
                     }
-                    ///鍒犻櫎鎺т欢
-                    var del = new Button
+                    if (Type != 1)
                     {
-                        BackgroundColor = ZigbeeColor.Current.LogicDelBlackColor1,
-                        Text = Language.StringByID(MyInternationalizationString.del),
-                    };
-                    conditionsRowLayout.AddRightView(del);
+                        selecteddevice.ordinaryBtn.Visible = true;
+                        selecteddevice.iconBtn.UnSelectedImagePath = icon;
+                        selecteddevice.ordinaryBtn.Text = name;
+                        selecteddevice.selecetddevicestateBtn.Text = state;
+                    }
+                    else
+                    {
+                        //璁惧鐘舵��
+                        selecteddevice.deviceNameBtn.Visible = true;
+                        selecteddevice.iconBtn.UnSelectedImagePath = icon;
+                        selecteddevice.deviceNameBtn.Text = name;
+                        selecteddevice.selecetddevicestateBtn.Text = state;
+                    }
+                    ///缂栬緫
+                    selecteddevice.edit.MouseUpEventHandler += (sender, e) =>
+                    {
+                        switch (Type)
+                        {
 
-                    del.MouseUpEventHandler += (sender, e) =>
+                            /// (0:鏃堕棿鐐规潯浠�;1:璁惧鐘舵�佸彉鍖栨潯浠�;2:鍏朵粬閫昏緫鏉′欢;3:璁℃暟鍣ㄦ潯浠�;4:鍊掕鏃�;5:鏃堕棿娈垫潯浠�;6:瀹夐槻鏉′欢;7:鍦扮悊浣嶇疆)
+                            case 0:
+                                {
+                                    var timePoint = new TimePoint();
+                                    UserView.HomePage.Instance.AddChidren(timePoint);
+                                    UserView.HomePage.Instance.PageIndex += 1;
+                                    timePoint.IsEditor = true;
+                                    timePoint.Show(conditions);
+                                }
+                                break;
+                            case 5:
+                                {
+                                    var timePage = new TimePage();
+                                    UserView.HomePage.Instance.AddChidren(timePage);
+                                    UserView.HomePage.Instance.PageIndex += 1;
+                                    timePage.str1 = conditions["StartHour"] + ":" + conditions["StartMin"] + "-" + conditions["StopHour"] + ":" + conditions["StopMin"];
+                                    timePage.IsEditor = true;
+                                    timePage.Show();
+                                }
+                                break;
+                            case 1:
+                                {
+                                    var deviceinof = Method.GetCommonDevice(conditions["MacAddr"], conditions["Epoint"]);
+                                    if (deviceinof.Type != DeviceType.DoorLock)
+                                    {
+                                        var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
+                                        this.AddChidren(flMain);
+                                        CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "condition_logic");
+                                    }
+                                    else
+                                    {
+                                        var memberList = new MemberList();
+                                        UserView.HomePage.Instance.AddChidren(memberList);
+                                        UserView.HomePage.Instance.PageIndex += 1;
+                                        MemberList.edit = true;
+                                        memberList.Show(deviceinof, conditions);
+                                    }
+                                }
+                                break;
+                            case 6:
+                                {
+                                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
+                                    this.AddChidren(flMain);
+                                    AddLogicPage.SecurityView(flMain, true);
+                                }
+                                break;
+                            case 7:
+                                {
+                                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
+                                    this.AddChidren(flMain);
+                                    AddLogicPage.LocationView(flMain, true);
+                                }
+                                break;
+                        }
+                    };
+                    ///鍒犻櫎鎺т欢
+                    selecteddevice.del.MouseUpEventHandler += (sender, e) =>
                     {
 
                         var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
@@ -1064,58 +671,12 @@
 
             #region  ----鏄剧ず鎵ц鐩爣----
 
-            var targetFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(targetFrameLayout);
+            Addview addactionview = new Addview();
+            addactionview.iconBtn.Visible = true;
+            addactionview.titleBtn.TextID = MyInternationalizationString.execute;
+            middle.AddChidren(addactionview.AddDeviceView());
 
-
-            var targetRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            targetFrameLayout.AddChidren(targetRowLayout);
-
-
-            var btntargettitle = new Button
-            {
-
-                Text = Language.StringByID(MyInternationalizationString.execute),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(60),
-                TextSize = 15,
-                Gravity = Gravity.CenterVertical,
-            };
-            targetRowLayout.AddChidren(btntargettitle);
-
-            var btntargetadd1 = new Button
-            {
-
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(57),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(965+58),
-            };
-            targetFrameLayout.AddChidren(btntargetadd1);
-
-            var btntargetadd = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/add.png",
-                X = Application.GetRealWidth(965 - 58),
-                Gravity = Gravity.CenterVertical,
-            };
-            targetRowLayout.AddChidren(btntargetadd);
-            EventHandler<MouseEventArgs> btntargetaddclick = (sender, e) =>
+            addactionview.clickBtn.MouseUpEventHandler+= (sender, e) =>
             {
                 Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
                 var deviceTarget = new DeviceTarget();
@@ -1123,8 +684,6 @@
                 UserView.HomePage.Instance.PageIndex += 1;
                 deviceTarget.Show();
             };
-            btntargetadd1.MouseUpEventHandler += btntargetaddclick;
-            btntargetadd.MouseUpEventHandler += btntargetaddclick;
 
             List<Dictionary<string, object>> ListActions = new List<Dictionary<string, object>>();
             ListActions.Clear();
@@ -1136,35 +695,10 @@
                 if (i == (ListActions.Count - 1))
                 {
 
-                    var addfl = new FrameLayout
-                    {
-                        Height = Application.GetRealHeight(160 + 30 + 50),
-                        BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    };
-                    middle.AddChidren(addfl);
-                    var addbtn = new Button
-                    {
-                        Height = Application.GetRealHeight(130 + 50),
-                        Width = Application.GetRealWidth(908),
-                        Y = Application.GetRealHeight(30),
-                        X = Application.GetRealWidth(86),
-                        UnSelectedImagePath = "ZigeeLogic/logicaddcolor.png",
-                    };
-                    addfl.AddChidren(addbtn);
-
-
-                    var addtextbtn = new Button
-                    {
-                        Height = Application.GetRealHeight(58),
-                        Width = Application.GetRealWidth(300),
-                        Y = Application.GetRealHeight(45 + 30),
-                        TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                        TextID = MyInternationalizationString.addfunction,
-                        X = Application.GetRealWidth(390),
-                        TextSize = 14,
-                    };
-                    addfl.AddChidren(addtextbtn);
-                    EventHandler<MouseEventArgs> addfunctionclick = (sender, e) =>
+                    LogicView.AddDeviceView addflview = new LogicView.AddDeviceView();
+                    addflview.titleBtn.TextID = MyInternationalizationString.addfunction;
+                    middle.AddChidren(addflview.AddFl());
+                    addflview.clickBtn.MouseUpEventHandler += (sender, e) =>
                     {
                         Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
                         var deviceTarget = new DeviceTarget();
@@ -1172,121 +706,33 @@
                         UserView.HomePage.Instance.PageIndex += 1;
                         deviceTarget.Show();
                     };
-                    addbtn.MouseUpEventHandler += addfunctionclick;
-                    addtextbtn.MouseUpEventHandler += addfunctionclick;
                 }
                 else
                 {
 
-                    var devicesFrameLayout = new FrameLayout
-                    {
-                        Height = Application.GetRealHeight(130),
-                        BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    };
-                    middle.AddChidren(devicesFrameLayout);
-
-                    ///鏄剧ず鍥炬爣
-                    var actionsIcon = new Button
-                    {
-                        Width = Application.GetRealWidth(81),
-                        Height = Application.GetRealHeight(81),
-                        X = Application.GetRealWidth(104),
-                        Y = Application.GetRealHeight(25),
-                        // UnSelectedImagePath = "ZigeeLogic/time.png",
-
-                    };
-                    devicesFrameLayout.AddChidren(actionsIcon);
-
-
-                    var actionsrowLayout = new RowLayout
-                    {
-                        Width = Application.GetRealWidth(800),
-                        Height = Application.GetRealHeight(130),
-                        X = Application.GetRealWidth(222),
-                        LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                    };
-                    devicesFrameLayout.AddChidren(actionsrowLayout);
-
-
+                    SelectedDeviceView actiondevice = new SelectedDeviceView();
+                    actiondevice.Show(middle);
                     var linkType = int.Parse(ListActions[i]["LinkType"].ToString());
                     var actions = ListActions[i];
+                    string name = "";
+                    string icon = "";
+                    string state = "";
 
                     switch (linkType)
                     {
                         case 0:
                             {
-                                var obj1 = actions["DeviceAddr"].ToString();
-                                var obj2 = actions["Epoint"].ToString();
-                                var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return ((obj.DeviceAddr == obj1) && (obj.DeviceEpoint.ToString() == obj2)); });
-                                if (deviceinof == null)
-                                {
-                                    
-                                    deviceinof = new ZigBee.Device.CommonDevice();
-                                    // continue;
-                                }
-                               
-                                ///璁惧鍚嶇ОButton
-                                var btndevicename = new Button
-                                {
-                                    Y = Application.GetRealHeight(20),
-                                    Height = Application.GetRealHeight(50),
-                                    Width = Application.GetRealWidth(400),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Text = deviceinof.DeviceEpointName,
-                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                                    TextSize = 14,
-                                };
-                                actionsrowLayout.AddChidren(btndevicename);
 
-                                ///鍖哄煙(鎴块棿)鍚嶇ОButton
-                                var btnregionname = new Button
-                                {
-                                    Y = btndevicename.Bottom + Application.GetRealHeight(10),
-                                    Width = Application.GetRealWidth(400),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Height = Application.GetRealHeight(50),
-                                    Text = "",//Language.StringByID(MyInternationalizationString.customroom),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                };
-                                actionsrowLayout.AddChidren(btnregionname);
-                                ///閫氳繃璁惧鎵惧埌鍖哄煙(鎴块棿)鍚嶇О
-                                Send.RoomNmae(btnregionname, deviceinof);
-                                ///鏄剧ず璁惧鏉′欢鐘舵�佹帶浠�
-                                var devicestatus = new Button
-                                {
-                                    Width = Application.GetRealWidth(400),
-                                    Height = Application.GetRealHeight(130),
-                                    Gravity = Gravity.CenterVertical,
-                                    TextAlignment = TextAlignment.CenterRight,
-                                    X = Application.GetRealWidth(400),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    TextSize = 14,
-                                };
-                                actionsrowLayout.AddChidren(devicestatus);
-
-                                ///缂栬緫璁惧鐘舵�丅utton
-                                var deviceedit = new Button
-                                {
-                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
-                                    Text = Language.StringByID(MyInternationalizationString.edit),
-                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                                };
-                                actionsrowLayout.AddRightView(deviceedit);
-
-                                ///缂栬緫鐐瑰嚮浜嬩欢
-                                deviceedit.MouseUpEventHandler += (sender, e) =>
-                                {
-                                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                                    this.AddChidren(flMain);
-                                    LogicDevicePage.CurrentDeviceStateView(flMain, deviceinof, true);
-                                };
-
+                                var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString());
+                                name = deviceinof.DeviceEpointName;
+                                actiondevice.regionNameBtn.Visible = true;
+                                Method.RoomNmae(actiondevice.regionNameBtn, deviceinof);
 
                                 switch (deviceinof.Type)
                                 {
                                     case DeviceType.OnOffOutput:
                                         {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/light.png";
+                                            icon = "ZigeeLogic/light.png";
 
                                             var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
                                             if (TaskList == null)
@@ -1299,18 +745,18 @@
                                                 {
                                                     if (status["Data1"].ToString() == "0")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
+                                                        state = Language.StringByID(MyInternationalizationString.close);
 
                                                     }
                                                     else if (status["Data1"].ToString() == "1")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.open);
+                                                        state = Language.StringByID(MyInternationalizationString.open);
 
                                                     }
                                                     else if (status["Data1"].ToString() == "2")
                                                     {
 
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.onoff);
+                                                        state = Language.StringByID(MyInternationalizationString.onoff);
                                                     }
                                                 }
 
@@ -1320,7 +766,7 @@
                                         break;
                                     case DeviceType.DimmableLight:
                                         {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/dimmableLight.png";
+                                            icon = "ZigeeLogic/dimmableLight.png";
                                             var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
                                             if (TaskList == null)
                                             {
@@ -1332,18 +778,18 @@
                                                 {
                                                     var intvalue = int.Parse(status["Data1"]);
                                                     var lightbrightnessvalue = (intvalue * 100) / 254;
-                                                    devicestatus.Text = lightbrightnessvalue.ToString() + "%";
+                                                    state = lightbrightnessvalue.ToString() + "%";
                                                 }
                                                 else if (status["TaskType"].ToString() == "1")
                                                 {
 
                                                     if (status["Data1"].ToString() == "0")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
+                                                        state = Language.StringByID(MyInternationalizationString.close);
                                                     }
                                                     else if (status["Data1"].ToString() == "2")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.onoff);
+                                                        state = Language.StringByID(MyInternationalizationString.onoff);
                                                     }
                                                 }
 
@@ -1354,7 +800,7 @@
                                         break;
                                     case DeviceType.WindowCoveringDevice:
                                         {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/curtain.png";
+                                            icon = "ZigeeLogic/curtain.png";
                                             var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
                                             if (TaskList == null)
                                             {
@@ -1366,15 +812,15 @@
                                                 {
                                                     if (status["Data1"] == "0")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.open);
+                                                        state = Language.StringByID(MyInternationalizationString.open);
                                                     }
                                                     else if (status["Data1"] == "1")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
+                                                        state = Language.StringByID(MyInternationalizationString.close);
                                                     }
                                                     else if (status["Data1"] == "5")
                                                     {
-                                                        devicestatus.Text = status["Data2"] + "%";
+                                                        state = status["Data2"] + "%";
                                                     }
                                                 }
 
@@ -1383,7 +829,7 @@
                                         break;
                                     case DeviceType.AirSwitch:
                                         {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/airswitch.png";
+                                            icon = "ZigeeLogic/airswitch.png";
 
                                             var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
                                             if (TaskList == null)
@@ -1396,18 +842,18 @@
                                                 {
                                                     if (status["Data1"].ToString() == "0")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
+                                                        state = Language.StringByID(MyInternationalizationString.close);
 
                                                     }
                                                     else if (status["Data1"].ToString() == "1")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.open);
+                                                        state = Language.StringByID(MyInternationalizationString.open);
 
                                                     }
                                                     else if (status["Data1"].ToString() == "2")
                                                     {
 
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.onoff);
+                                                        state = Language.StringByID(MyInternationalizationString.onoff);
                                                     }
                                                 }
 
@@ -1417,7 +863,7 @@
                                         break;
                                     case DeviceType.Thermostat:
                                         {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/ac.png";
+                                            icon = "ZigeeLogic/ac.png";
 
                                             var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
                                             if (TaskList == null)
@@ -1428,7 +874,7 @@
                                             bool ifclose = false;
                                             foreach (var status in TaskList)
                                             {
-                                                
+
                                                 if (TaskList.Count == 1)
                                                 {
                                                     //鏁扮粍鍙湁涓�涓厓绱犺鏄庡綋鍓嶇┖璋冪姸鎬佷负鍏筹紱
@@ -1513,11 +959,11 @@
                                             }
                                             if (ifclose)
                                             {
-                                                devicestatus.Text = modetext + ";" + temperaturetext + "鈩�;" + speedtext;
+                                                state = modetext + ";" + temperaturetext + "鈩�;" + speedtext;
                                             }
                                             else
                                             {
-                                                devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
+                                                state = Language.StringByID(MyInternationalizationString.close);
 
                                             }
                                         }
@@ -1555,155 +1001,31 @@
                                     #endregion
                                 }
 
-                                actionsIcon.UnSelectedImagePath = "ZigeeLogic/scene.png";
-                                ///璁惧鍚嶇ОButton
-                                var btndevicename = new Button
-                                {
-                                    Y = Application.GetRealHeight(20),
-                                    Height = Application.GetRealHeight(50),
-                                    Width = Application.GetRealWidth(500),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Text = sceneinof.Name,
-                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                                    TextSize = 14,
-                                };
-                                actionsrowLayout.AddChidren(btndevicename);
-
-                                ///鍖哄煙(鎴块棿)鍚嶇ОButton
-                                var btnregionname = new Button
-                                {
-                                    Y = btndevicename.Bottom + Application.GetRealHeight(10),
-                                    Width = Application.GetRealWidth(500),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Height = Application.GetRealHeight(50),
-                                    Text = "",//Language.StringByID(MyInternationalizationString.customroom),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                };
-                                actionsrowLayout.AddChidren(btnregionname);
+                                icon = "ZigeeLogic/scene.png";
+                                name = sceneinof.Name;
+                                actiondevice.regionNameBtn.Visible = true;
                                 /////閫氳繃璁惧鎵惧埌鍖哄煙(鎴块棿)鍚嶇О
                                 Common.Room room = new Common.Room();
-                                btnregionname.Text = room.GetRoomNameBySceneId(sceneinof.Id);
-                                //Send.RoomNmae(btnregionname, deviceinof);
+                                actiondevice.regionNameBtn.Text = room.GetRoomNameBySceneId(sceneinof.Id);
 
-
-                            }
-                            break;
-                        case 4:
-                            {
-                                var logicinof = Common.Logic.LogicList.Find((obj) => { return obj.LogicId.ToString() == actions["DeviceAddr"].ToString(); });
-                                if (logicinof == null)
-                                {
-                                    continue;
-                                }
-                                ///鏄剧ず閫昏緫鍚嶇О
-                                var btnlogic = new Button
-                                {
-                                    Width = Application.GetRealWidth(500),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Gravity = Gravity.CenterVertical,
-                                    Text = logicinof.LogicName,
-                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                                    TextSize = 14,
-                                    //TextColor = 0xff121212,
-                                };
-                                actionsrowLayout.AddChidren(btnlogic);
-
-
-                                var logicedit = new Button
-                                {
-                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
-                                    Text = Language.StringByID(MyInternationalizationString.edit),
-                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                                };
-                                actionsrowLayout.AddRightView(logicedit);
-                                logicedit.MouseUpEventHandler += (sender, e) =>
-                                {
-                                    var selectedLogicState = new SelectedLogicState();
-                                    UserView.HomePage.Instance.AddChidren(selectedLogicState);
-                                    UserView.HomePage.Instance.PageIndex += 1;
-                                    selectedLogicState.IsDeviceEditor = true;
-                                    selectedLogicState.Show(logicinof);
-                                };
-
-                                ///鏄剧ずLogic鏉′欢鐘舵�佹帶浠�
-                                var logicstatus = new Button
-                                {
-                                    Width = Application.GetRealWidth(300),
-                                    Height = Application.GetRealHeight(160),
-                                    Gravity = Gravity.CenterVertical,
-                                    //TextColor = 0xff121212,
-                                    X = Application.GetRealWidth(1080 - 330),
-                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                                    TextAlignment = TextAlignment.CenterRight,
-                                    TextSize = 14,
-                                };
-                                actionsrowLayout.AddChidren(logicstatus);
-
-                                if (actions["EnableLogic"].ToString() == "1")
-                                {
-                                    logicstatus.Text = Language.StringByID(MyInternationalizationString.open1);
-                                }
-                                else
-                                {
-                                    logicstatus.Text = Language.StringByID(MyInternationalizationString.disable);
-                                }
                             }
                             break;
                         case 6:
                             {
-                                var btnsecurity = new Button
-                                {
-                                    Width = Application.GetRealWidth(700),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Gravity = Gravity.CenterVertical,
-                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                                    //TextColor = 0xff121212,
-                                    TextID = MyInternationalizationString.security,
-                                    TextSize = 14,
-                                };
-                                //actionsrowLayout.AddChidren(btnsecurity);
 
-
-                                var btnsecurityedit = new Button
-                                {
-                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
-                                    Text = Language.StringByID(MyInternationalizationString.edit),
-                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                                };
-                                actionsrowLayout.AddRightView(btnsecurityedit);
-                                btnsecurityedit.MouseUpEventHandler += (sender, e) =>
-                                {
-                                    var securityMode = new SecurityMode();
-                                    UserView.HomePage.Instance.AddChidren(securityMode);
-                                    UserView.HomePage.Instance.PageIndex += 1;
-                                    securityMode.IsDeviceEditor = true;
-                                    securityMode.Show();
-                                };
-
-                                ///鏄剧ず瀹夐槻鏉′欢鐘舵�佹帶浠�
-                                var securitystatus = new Button
-                                {
-                                    Width = Application.GetRealWidth(500),
-                                    Height = Application.GetRealHeight(130),
-                                    Gravity = Gravity.CenterVertical,
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    TextSize = 14,
-                                };
-                                actionsrowLayout.AddChidren(securitystatus);
 
 
                                 if (actions["SecuritySetting"].ToString() == "0")
                                 {
                                     if (actions["Password"].ToString() == "888888")
                                     {
-                                        actionsIcon.UnSelectedImagePath = "ZigeeLogic/withdrawal.png";
-                                        securitystatus.Text = Language.StringByID(MyInternationalizationString.urgentwithdrawal);
+                                        icon = "ZigeeLogic/withdrawal.png";
+                                        state = Language.StringByID(MyInternationalizationString.urgentwithdrawal);
                                     }
                                     else
                                     {
-                                        actionsIcon.UnSelectedImagePath = "ZigeeLogic/withdrawal.png";
-                                        securitystatus.Text = Language.StringByID(MyInternationalizationString.withdrawal);
+                                        icon = "ZigeeLogic/withdrawal.png";
+                                        state = Language.StringByID(MyInternationalizationString.withdrawal);
 
                                     }
                                 }
@@ -1711,13 +1033,13 @@
                                 {
                                     if (actions["SecurityModeId"].ToString() == "1")
                                     {
-                                        actionsIcon.UnSelectedImagePath = "ZigeeLogic/athome.png";
-                                        securitystatus.Text = Language.StringByID(MyInternationalizationString.logicathomegarrison);
+                                        icon = "ZigeeLogic/athome.png";
+                                        state = Language.StringByID(MyInternationalizationString.logicathomegarrison);
                                     }
                                     else if (actions["SecurityModeId"].ToString() == "2")
                                     {
-                                        actionsIcon.UnSelectedImagePath = "ZigeeLogic/leavehome.png";
-                                        securitystatus.Text = Language.StringByID(MyInternationalizationString.logicremovehomegarrison);
+                                        icon = "ZigeeLogic/leavehome.png";
+                                        state = Language.StringByID(MyInternationalizationString.logicremovehomegarrison);
                                     }
                                 }
 
@@ -1729,70 +1051,84 @@
                                 var Minutes = delaytimevalue / 60;
                                 var seconds = delaytimevalue % 60;
 
-                                actionsIcon.UnSelectedImagePath = "ZigeeLogic/delay.png";
-                                ///寤舵椂Button
-                                var delaytimeBtn = new Button
-                                {
-                                    Width = Application.GetRealWidth(500),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    TextSize = 14,
-                                };
-                                actionsrowLayout.AddChidren(delaytimeBtn);
+                                icon = "ZigeeLogic/delay.png";
+                               
                                 if (Minutes != 0)
                                 {
                                     if (seconds == 0)
                                     {
-                                        delaytimeBtn.Text = Minutes.ToString() + Language.StringByID(MyInternationalizationString.minute);
+                                        state = Minutes.ToString() + Language.StringByID(MyInternationalizationString.minute);
                                     }
                                     else
                                     {
-                                        delaytimeBtn.Text = Minutes.ToString() + Language.StringByID(MyInternationalizationString.minute) + seconds.ToString() + Language.StringByID(MyInternationalizationString.second);
-
+                                        state = Minutes.ToString() + Language.StringByID(MyInternationalizationString.minute) + seconds.ToString() + Language.StringByID(MyInternationalizationString.second);
                                     }
                                 }
                                 else
                                 {
-                                    delaytimeBtn.Text = seconds.ToString() + Language.StringByID(MyInternationalizationString.second);
+                                    state = seconds.ToString() + Language.StringByID(MyInternationalizationString.second);
                                 }
+                                //璁板綍寤舵椂锛�
+                                actiondevice.edit.Tag = i;
+                            };
+                            break;
+                    }
+                    if (linkType == 6 || linkType == 7)
+                    {
+                        actiondevice.ordinaryBtn.Visible = true;
+                        actiondevice.iconBtn.UnSelectedImagePath = icon;
+                        actiondevice.ordinaryBtn.Text = name;
+                        actiondevice.selecetddevicestateBtn.Text = state;
+                    }
+                    else
+                    {
+                        //璁惧鐘舵��
+                        actiondevice.deviceNameBtn.Visible = true;
+                        actiondevice.iconBtn.UnSelectedImagePath = icon;
+                        actiondevice.deviceNameBtn.Text = name;
+                        actiondevice.selecetddevicestateBtn.Text = state;
+                    }
+                    ///缂栬緫
+                    actiondevice.edit.MouseUpEventHandler += (sender, e) =>
+                    {
+                        switch (linkType)
+                        {
 
-
-                                ///寤舵椂缂栬緫Button
-                                var delaytimeedit = new Button
+                            case 0:
                                 {
-                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
-                                    Text = Language.StringByID(MyInternationalizationString.edit),
-                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                                    Tag = i,
-                                };
-                                actionsrowLayout.AddRightView(delaytimeedit);
-
-                                ///缂栬緫鐐瑰嚮浜嬩欢
-                                delaytimeedit.MouseUpEventHandler += (sender, e) =>
+                                    var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString());
+                                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
+                                    this.AddChidren(flMain);
+                                    CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "action_logic");
+                                }
+                                break;
+                            case 6:
+                                {
+                                    var securityMode = new SecurityMode();
+                                    UserView.HomePage.Instance.AddChidren(securityMode);
+                                    UserView.HomePage.Instance.PageIndex += 1;
+                                    securityMode.IsDeviceEditor = true;
+                                    securityMode.Show();
+                                }
+                                break;
+                            case 7:
                                 {
                                     var delayTime = new DelayTime();
                                     UserView.HomePage.Instance.AddChidren(delayTime);
                                     UserView.HomePage.Instance.PageIndex += 1;
-                                    delayTime.Show(int.Parse(delaytimeedit.Tag.ToString()), true);
-                                };
-
-                            };
-                            break;
-                    }
-                    ///鍒犻櫎鎺т欢
-                    var del = new Button
-                    {
-                        BackgroundColor = ZigbeeColor.Current.LogicDelBlackColor1,
-                        Text = Language.StringByID(MyInternationalizationString.del),
+                                    delayTime.Show(int.Parse(actiondevice.edit.Tag.ToString()), true);
+                                }
+                                break;
+                        }
                     };
-                    actionsrowLayout.AddRightView(del);
-
-                    del.MouseUpEventHandler += (sender, e) =>
+                    ///鍒犻櫎鎺т欢
+                    actiondevice.del.MouseUpEventHandler += (sender, e) =>
                     {
+
                         var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
-                       Language.StringByID(MyInternationalizationString.doyouwanttodelete),
-                       Language.StringByID(MyInternationalizationString.confrim));
-                       alert.Show();
+                        Language.StringByID(MyInternationalizationString.doyouwanttodelete),
+                        Language.StringByID(MyInternationalizationString.confrim));
+                        alert.Show();
                         alert.ConfirmClickEvent += () =>
                         {
                             Common.Logic.CurrentLogic.Actions.Remove(actions);
@@ -1804,7 +1140,6 @@
                         };
 
                     };
-
                 }
             }
 
@@ -1818,35 +1153,12 @@
             };
             middle.AddChidren(fraline1);
 
-
-            var weekFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(weekFrameLayout);
-            var weekRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            weekFrameLayout.AddChidren(weekRowLayout);
-
-            var settxet = new Button
-            {
-                Text = Language.StringByID(MyInternationalizationString.setupcycle),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(60),
-                Gravity = Gravity.CenterVertical,
-                TextSize = 14,
-            };
-            weekRowLayout.AddChidren(settxet);
-            var btnweektext = new Button
+            Addview weekview = new Addview();
+            weekview.iconBtn.Visible = true;
+            weekview.iconBtn.UnSelectedImagePath = "ZigeeLogic/next.png";
+            weekview.titleBtn.TextID = MyInternationalizationString.setupcycle;
+            middle.AddChidren(weekview.AddDeviceView());
+            var weekBtn = new Button
             {
                 Width = Application.GetRealWidth(595),
                 Height = Application.GetRealHeight(60),
@@ -1854,29 +1166,16 @@
                 //Text = "姣忓ぉ",
                 TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                 TextID = MyInternationalizationString.everyday,
-                Y = Application.GetRealHeight(35),
-                X = settxet.Right,
+                Y = Application.GetRealHeight(35+30),
+                X = weekview.titleBtn.Right,
                 TextSize = 14,
             };
-            weekRowLayout.AddChidren(btnweektext);
-
-            var nextBtn = new Button
-            {
-
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = Application.GetRealWidth(965 - 58),
-                Gravity = Gravity.CenterVertical,
-
-            };
-            weekRowLayout.AddChidren(nextBtn);
-
-            UpdateWeek(btnweektext);
+            weekview.frameLayout.AddChidren(weekBtn);
+            Method.UpdateWeek(weekBtn,Common.Logic.CurrentLogic);
             EventHandler<MouseEventArgs> cycleclick = (sender, e) =>
             {
                 /*------淇濈暀姣忔湀,姣忓勾绫诲瀷*/
-                var cycle = new Cycle(() => { UpdateWeek(btnweektext); });
+                var cycle = new Cycle(() => { Method.UpdateWeek(weekBtn, Common.Logic.CurrentLogic);});
                 UserView.HomePage.Instance.AddChidren(cycle);
                 UserView.HomePage.Instance.PageIndex += 1;
                 cycle.Show();
@@ -1886,671 +1185,104 @@
                 //UserView.HomePage.Instance.PageIndex += 1;
                 //cyclicCycle.Show();
             };
-            btnweektext.MouseUpEventHandler += cycleclick;
-            nextBtn.MouseUpEventHandler += cycleclick;
+            weekBtn.MouseUpEventHandler += cycleclick;
+            weekview.clickBtn.MouseUpEventHandler += cycleclick;
             #endregion
 
             #region  ----鎺ㄩ�佽缃�----
-
-            var pushFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(pushFrameLayout);
-
-            var pushswitchRowlayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            pushFrameLayout.AddChidren(pushswitchRowlayout);
-
-            var btnswitchtxet = new Button
-            {
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(60),
-                Gravity = Gravity.CenterVertical,
-                TextID = MyInternationalizationString.pushswitch,
-                TextSize = 14,
-            };
-            pushswitchRowlayout.AddChidren(btnswitchtxet);
-
-            var btnswitch = new Button
-            {
-                Width = Application.GetMinRealAverage(104),
-                Height = Application.GetMinRealAverage(63),
-                UnSelectedImagePath = "ZigeeLogic/logicclose.png",
-                SelectedImagePath = "ZigeeLogic/logicopen.png",
-                X = Application.GetRealWidth(965 - 104),
-                Gravity = Gravity.CenterVertical,
-            };
-            pushswitchRowlayout.AddChidren(btnswitch);
-
-
-            var custompushFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(0),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(custompushFrameLayout);
-
-            var custompushRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            custompushFrameLayout.AddChidren(custompushRowLayout);
-
-            var btncustompush = new Button
-            {
-                TextID = MyInternationalizationString.custompush,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(60),
-                Gravity = Gravity.CenterVertical,
-                TextSize = 14,
-            };
-            custompushRowLayout.AddChidren(btncustompush);
-
-
-            var custompushback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = Application.GetRealWidth(965 - 58),
-                Gravity = Gravity.CenterVertical,
-            };
-            custompushRowLayout.AddChidren(custompushback);
-            EventHandler<MouseEventArgs> customclick = (sender, e) =>
-            {
-                var CustomText = new CustomText();
-                UserView.HomePage.Instance.AddChidren(CustomText);
-                UserView.HomePage.Instance.PageIndex += 1;
-                CustomText.Show();
-
-            };
-            btncustompush.MouseUpEventHandler += customclick;
-            custompushback.MouseUpEventHandler += customclick;
-            custompushRowLayout.MouseUpEventHandler += customclick;
-            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);
-            }
+            Method.Push(middle);
+        
             #endregion
 
-
-          
-            btnsave.MouseUpEventHandler += async (sender, e) =>
+            saveBtn.clickviewBtn.MouseUpEventHandler +=(sender, e) =>
             {
                 var name = logicTextBox.Text.Trim();
-                if (string.IsNullOrEmpty(logicTextBox.Text.Trim()))
-                {
-                    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;
-                //}
-
-                Common.Logic.CurrentLogic.LogicName = name;
-                bool succeed = false;
-                //鍒ゆ柇鏄柊娣诲姞閫昏緫(榛樿0)杩樻槸淇敼閫昏緫
-                CommonPage.Loading.Start();
-                if (Common.Logic.CurrentLogic.LogicId == 0)
-                {
-                    //鍙戦�佹坊鍔犻�昏緫鍛戒护
-                    var logicifon = await Send.AddModifyLogic(Common.Logic.CurrentLogic);
-                    if (logicifon != null && logicifon.LogicId != 0)
-                    {
-                        succeed = true;
-                        Common.Logic.CurrentLogic.LogicId = logicifon.LogicId;
-                        Common.Logic.LogicList.Add(Common.Logic.CurrentLogic);
-                        if (tag)
-                        {
-                            Send.Zj(tag, Common.Logic.CurrentLogic);
-                        }
-                    }
-                }
-                else
-                {
-                    //鍙戦�佷慨鏀归�昏緫鍛戒护
-                   var modlogic=Send.AddModifyLogic(Common.Logic.CurrentLogic);
-                    //缂栬緫榛樿鎴愬姛锛堜笉鑰冭檻缃戠粶鎯呭喌锛夛紱
-                    succeed = true;
-                }
-                CommonPage.Loading.Hide();
-
-                if (!succeed)//succeed鏍囪鏄坊鍔犳垚鍔熻繕鏄け璐�
-                {
-                    //缃戝叧鍥炲澶辫触锛屼笉鍏抽棴鐣岄潰锛岃瀹冨仠鐣欏綋鍓嶇晫闈紱
-                    //锛堝師鍥狅細鑰冭檻鍒板け璐ラ噸鏂扮紪杈戝師鏉ユ暟鎹粰鐢ㄦ埛甯︽潵浜嗛夯鐑︼級
-                    ///鎻愮ず锛氭坊鍔犺嚜鍔ㄥ寲澶辫触锛�
-                    //TipView("娣诲姞鑷姩鍖栧け璐�");
-                    //return;
-                }
-                UserView.HomePage.Instance.RemoveViewByTag("Logic");
-                Category.Category.instance?.RefreshBodyView();
-           
+                Method.SaveLogic(IfString._Logic,name, IfString.Tag, Common.Logic.CurrentLogic);
             };
-
-
-        }
-        /// <summary>
-        /// 鏇存柊鎵ц鍛ㄦ湡鐨勬柟娉�
-        /// </summary>
-        /// <param name="btndisplaycycle">Btndisplaycycle.</param>
-        void UpdateWeek(Button btndisplaycycle)
-        {
-
-            switch (Common.Logic.CurrentLogic.TimeAttribute.Repeat)
-            {
-                ///0:鍙墽琛屼竴娆★紝鎵ц鍚嶪sEnable鍊肩疆;1,浠婂勾鍐呮墽琛�;2锛氭瘡澶╂墽琛�;3锛氭瘡鏈堟墽琛�;4锛氭瘡骞存墽琛�;5锛氬懆閲嶅銆�
-                case 0:
-                    {
-                        btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.executeonce);
-                    }; break;
-                case 1: { }; break;
-                case 2:
-                    {
-                        btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.everyday);
-                    }; break;
-                case 3:
-                    {
-
-                        string len = "", value = "";
-                        var stringvalue = Convert.ToString(Common.Logic.CurrentLogic.TimeAttribute.MonthDate, 2);
-                        var str = stringvalue.Insert(0, new string('0', 32 - stringvalue.Length));
-                        for (int j = 31; j >= 0; j--)
-                        {
-                            len += str.Substring(j, 1);
-                        }
-                        for (int j = 0; j < len.Length; j++)
-                        {
-                            var strvalue = len.Substring(j, 1);
-                            if (strvalue == "1")
-                            {
-                                value += (j + 1).ToString() + ",";
-                            }
-                        }
-                        btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.monthly) + value.TrimEnd(',') + Language.StringByID(MyInternationalizationString.day);
-
-                    }; break;
-                case 4:
-                    {
-
-                        Dictionary<int, int> dictionary = new Dictionary<int, int>();
-                        ///鎵惧嚭鎵ц鐨勬湀浠藉拰澶╂暟
-                        if (Common.Logic.CurrentLogic.TimeAttribute.SelectMonDate.Count != 0)
-                        {
-                            for (int i = 0; i < Common.Logic.CurrentLogic.TimeAttribute.SelectMonDate.Count; i++)
-                            {
-                                var dayvalue = Common.Logic.CurrentLogic.TimeAttribute.SelectMonDate[i];
-                                if (dayvalue != 0)
-                                {
-                                    dictionary.Add(i + 1, dayvalue);
-                                }
-                            }
-                        }
-                        if (dictionary.Count != 0 && dictionary.Count == 1)
-                        {
-                            string len = "", leng = "";
-                            int minvalue = 0, Maximum = 0;
-                            foreach (var value in dictionary)
-                            {
-                                ///鍙栧嚭鏈堜唤
-                                var month = value.Key;
-                                ///鍙栧嚭鏃ユ暟
-                                var day = value.Value;
-                                var maxvalue = Convert.ToString(day, 2);
-                                var str = maxvalue.Insert(0, new string('0', 32 - maxvalue.Length));
-                                for (int j = 31; j >= 0; j--)
-                                {
-                                    len += str.Substring(j, 1);
-                                }
-
-                                for (int j = 0; j < len.Length; j++)
-                                {
-                                    var strvalue = len.Substring(j, 1);
-                                    if (strvalue == "1")
-                                    {
-                                        minvalue = j + 1;
-                                        break;
-                                    }
-                                }
-                                for (int j = 0; j < len.Length; j++)
-                                {
-                                    var strvalue = len.Substring(j, 1);
-                                    if (strvalue == "1")
-                                    {
-                                        Maximum = j + 1;
-                                    }
-                                }
-
-                                if (month.ToString().Length < 2)
-                                {
-                                    leng = "0" + month.ToString();
-                                }
-                                else
-                                {
-                                    leng = month.ToString();
-                                }
-                                if (minvalue == Maximum)
-                                {
-                                    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.everyyear) + leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString());
-                                }
-                                else
-                                {
-                                    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.everyyear) + leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString()) + "-" + leng + "/" + (Maximum.ToString().Length < 2 ? "0" + Maximum.ToString() : Maximum.ToString());
-                                }
-                            }
-
-                        }
-                        else
-                        {
-                            int b = 0;
-                            string stringtext = "";
-                            foreach (var value in dictionary)
-                            {
-                                string len = "", leng = "";
-                                int minvalue = 0, Maximum = 0;
-                                ///鍙栧嚭鏈堜唤
-                                var month = value.Key;
-                                ///鍙栧嚭鏃ユ暟
-                                var day = value.Value;
-                                var maxvalue = Convert.ToString(day, 2);
-                                var str = maxvalue.Insert(0, new string('0', 32 - maxvalue.Length));
-                                for (int j = 31; j >= 0; j--)
-                                {
-                                    len += str.Substring(j, 1);
-                                }
-
-
-                                if (month.ToString().Length < 2)
-                                {
-                                    leng = "0" + month.ToString();
-                                }
-                                else
-                                {
-                                    leng = month.ToString();
-                                }
-
-
-
-                                if (b == 0)
-                                {
-                                    for (int j = 0; j < len.Length; j++)
-                                    {
-                                        var strvalue = len.Substring(j, 1);
-                                        if (strvalue == "1")
-                                        {
-                                            minvalue = j + 1;
-                                            break;
-                                        }
-                                    }
-                                    stringtext += leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString()) + "-";
-
-                                }
-
-                                if (b == dictionary.Count - 1)
-                                {
-                                    for (int j = 0; j < len.Length; j++)
-                                    {
-                                        var strvalue = len.Substring(j, 1);
-                                        if (strvalue == "1")
-                                        {
-                                            Maximum = j + 1;
-                                        }
-                                    }
-                                    stringtext += leng + "/" + (Maximum.ToString().Length < 2 ? "0" + Maximum.ToString() : Maximum.ToString());
-
-                                }
-                                b++;
-                            }
-                            btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.everyyear) + stringtext;
-                        }
-
-                    }; break;
-                case 5:
-                    {
-                        string len = "", text = "";
-                        List<int> listvalueInt = new List<int>();
-                        listvalueInt.Clear();
-                        var maxvalue = Convert.ToString(Common.Logic.CurrentLogic.TimeAttribute.WeekDay, 2);
-                        var str = maxvalue.Insert(0, new string('0', 8 - maxvalue.Length));
-                        for (int j = 7; j >= 0; j--)
-                        {
-                            len += str.Substring(j, 1);
-                        }
-
-                        for (int j = 0; j < len.Length; j++)
-                        {
-                            var strvalue = len.Substring(j, 1);
-                            if (strvalue == "1")
-                            {
-                                listvalueInt.Add(j + 1);
-
-
-                                if ((j + 1) == 1)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.mon1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.mon) + ",";
-                                }
-                                else if ((j + 1) == 2)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.tue1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.tue) + ",";
-                                }
-                                else if ((j + 1) == 3)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.wed1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.wed) + ",";
-                                }
-                                else if ((j + 1) == 4)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.thu1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.thu) + ",";
-                                }
-                                else if ((j + 1) == 5)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.frl1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.frl) + ",";
-                                }
-                                else if ((j + 1) == 6)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.sat1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.sat) + ",";
-                                }
-                                else if ((j + 1) == 7)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.sun1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.sun) + ",";
-                                }
-
-
-                            }
-                        }
-                        //鏆傛椂闅愯棌鎺夛紝闇�瑕佹樉绀哄懆鏈拰宸ヤ綔鏃ュ啀鏀惧紑锛�
-                        //if (listvalueInt.Count == 5 && !listvalueInt.Contains(6) && !listvalueInt.Contains(7))
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.workingday);
-                        //}
-                        //else if (listvalueInt.Count == 2 && listvalueInt.Contains(6) && listvalueInt.Contains(7))
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.weekend);
-                        //}
-                        //else if (listvalueInt.Count == 7)
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.everyday);
-                        //}
-                        //else
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.week1) + text.Replace(Language.StringByID(MyInternationalizationString.week1), "").TrimEnd(',');
-                        //}
-                        btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.week1) + text.Replace(Language.StringByID(MyInternationalizationString.week1), "").TrimEnd(',');
-                        //btndisplaycycle.Text = text.TrimEnd(',');
-                    }; break;
-            }
-
-
         }
 
         void ConditionView(bool edit)
         {
             Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
-
-            #region 缁勫悎鏉′欢View
-            FrameLayout flMain = new FrameLayout { BackgroundColor = 0x50000000 };
+            #region  ------缁勫悎鏉′欢鐣岄潰甯冨眬閮ㄥ垎   
+            var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor };
             this.AddChidren(flMain);
-            flMain.MouseUpEventHandler += (sender2, e2) =>
+            CompleteView completeView = new CompleteView();
+            flMain.AddChidren(completeView.Show(2));
+            completeView.Btntitle.TextID = MyInternationalizationString.condition;
+            EventHandler<MouseEventArgs> clickcancel = (sender, e) =>
             {
-                flMain.RemoveFromParent();
-            };
-
-
-            var framelayout = new FrameLayout
-            {
-                Width = Application.GetRealWidth(1080),
-                Height = Application.GetRealHeight(530),
-                Y = Application.GetRealHeight(1920 - 530),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                Radius = (uint)Application.GetRealHeight(60),
-            };
-            flMain.AddChidren(framelayout);
-            framelayout.SetCornerWithSameRadius(Application.GetRealHeight(58),HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerTopRight);
-
-            #region  -------鍙栨秷   瀹屾垚
-            var timetype = new RowLayout
-            {
-                Height = Application.GetRealHeight(140),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            framelayout.AddChidren(timetype);
-            var Btncancel = new Button
-            {
-                TextID = MyInternationalizationString.cancel,
-                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                X = Application.GetRealWidth(80),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextSize = 14,
-            };
-            timetype.AddChidren(Btncancel);
-            Btncancel.MouseUpEventHandler += (sender16, e16) =>
-            {
-                flMain.RemoveFromParent();
                 UserView.HomePage.Instance.ScrollEnabled = true;
+                flMain.RemoveFromParent();
             };
+            flMain.MouseUpEventHandler += clickcancel;
+            completeView.Btncancel.MouseUpEventHandler += clickcancel;
 
-            var Btntitle = new Button
-            {
-                TextID = MyInternationalizationString.condition,
-                TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(320),
-                TextAlignment = TextAlignment.Center,
-                X = Btncancel.Right + Application.GetRealWidth(100),
-                TextSize = 16,
-            };
-            timetype.AddChidren(Btntitle);
-            var Btncomplete = new Button
-            {
-                TextID = MyInternationalizationString.complete,
-                TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                TextAlignment = TextAlignment.CenterRight,
-                X = Btntitle.Right + Application.GetRealWidth(100),
-                TextSize = 14,
-
-            };
-            timetype.AddChidren(Btncomplete);
+            //婊¤冻鎵�鏈夋潯浠�
+            mFunView allFunView = new mFunView();
+            allFunView.frameLayout.Y = Application.GetRealHeight(140 + 20);
+            completeView.Show(2).AddChidren(allFunView.Show());
+            allFunView.titleBtn.TextID = MyInternationalizationString.Allconditions;
+            //婊¤冻鍏朵腑涓�涓潯浠�
+            mFunView ormFunview = new mFunView();
+            ormFunview.frameLayout.Y = allFunView.frameLayout.Bottom;
+            completeView.Show(2).AddChidren(ormFunview.Show());
+            ormFunview.titleBtn.TextID = MyInternationalizationString.anycondition;
+            ormFunview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
             #endregion
 
-            #region  -------婊¤冻鎵�鏈夋潯浠�   婊¤冻鍏朵腑涓�涓潯浠�
-
-
-            #region  -------婊¤冻鎵�鏈夋潯浠�
-
-
-            var andFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = timetype.Bottom + Application.GetRealHeight(20),
-            };
-            framelayout.AddChidren(andFrameLayout);
-
-
-            var androw = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            andFrameLayout.AddChidren(androw);
-            var andbtn = new Button
-            {
-
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.Allconditions,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                TextSize = 14,
-
-            };
-            androw.AddChidren(andbtn);
-
-            var andSelected = new SelectedButton();
-            androw.AddChidren(andSelected);
-            #endregion
-            #region  -------婊¤冻鍏朵腑涓�涓潯浠�
-
-            var orFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = andFrameLayout.Bottom,
-
-            };
-            framelayout.AddChidren(orFrameLayout);
-
-
-
-            var orrow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-            };
-            orFrameLayout.AddChidren(orrow);
-            var orbtn = new Button
-            {
-
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.anycondition,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                TextSize = 14,
-            };
-            orrow.AddChidren(orbtn);
-
-            var orSelected = new SelectedButton();
-            orrow.AddChidren(orSelected);
-            #endregion
             ///婊¤冻鎵�鏈夋潯浠剁偣鍑讳簨浠�
-            EventHandler<MouseEventArgs> andclick = (sedner14, e14) =>
+            allFunView.clickviewBtn.MouseUpEventHandler += (sedner, e) =>
             {
-                andSelected.Visible = true;
-                orSelected.Visible = false;
-                andbtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                orbtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                allFunView.selectedIconBtn.Visible = true;
+                ormFunview.selectedIconBtn.Visible = false;
+                allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
             };
-            androw.MouseUpEventHandler += andclick;
-            andbtn.MouseUpEventHandler += andclick;
-            andSelected.MouseUpEventHandler += andclick;
-            andFrameLayout.MouseUpEventHandler += andclick;
-
-
             ///婊¤冻鍏朵腑涓�涓潯浠剁偣鍑讳簨浠�
-            EventHandler<MouseEventArgs> orclick = (sedner15, e15) =>
+            ormFunview.clickviewBtn.MouseUpEventHandler += (sedner, e) =>
             {
-                andSelected.Visible = false;
-                orSelected.Visible = true;
-                andbtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                orbtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                allFunView.selectedIconBtn.Visible = false;
+                ormFunview.selectedIconBtn.Visible = true;
+                allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
             };
-            orrow.MouseUpEventHandler += orclick;
-            orbtn.MouseUpEventHandler += orclick;
-            orSelected.MouseUpEventHandler += orclick;
-            orFrameLayout.MouseUpEventHandler += orclick;
-
-            #endregion
-            #endregion
 
             if (edit)
             {
                 if (Common.Logic.CurrentLogic.Relationship == 0)
                 {
-                    andSelected.Visible = true;
-                    orSelected.Visible = false;
-                    andbtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                    orbtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                    allFunView.selectedIconBtn.Visible = true;
+                    ormFunview.selectedIconBtn.Visible = false;
+                    allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                    ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
                 }
                 else
                 {
-                    andSelected.Visible = false;
-                    orSelected.Visible = true;
-                    andbtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                    orbtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                    allFunView.selectedIconBtn.Visible = false;
+                    ormFunview.selectedIconBtn.Visible = true;
+                    allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                    ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
                 }
             }
-            Btncomplete.MouseUpEventHandler += (sender, e) =>
+            completeView.Btncomplete.MouseUpEventHandler += (sender, e) =>
             {
-                if (!andSelected.Visible && !orSelected.Visible)
+                if (!allFunView.selectedIconBtn.Visible && !ormFunview.selectedIconBtn.Visible)
                 {
                     ///鍙互鎻愮ず鏈�変腑鐘舵�侊紱
                     return;
                 }
                 flMain.RemoveFromParent();
 
-                if (andSelected.Visible)
+                if (allFunView.selectedIconBtn.Visible)
                 {
                     Common.Logic.CurrentLogic.Relationship = 0;
-
+                   
                 }
-                if (orSelected.Visible)
+                if (ormFunview.selectedIconBtn.Visible)
                 {
                     Common.Logic.CurrentLogic.Relationship = 1;
-
+                   
                 }
                 if (edit)
                 {
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs
deleted file mode 100644
index e3d9fca..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicDevicePage.cs
+++ /dev/null
@@ -1,2204 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Newtonsoft.Json.Linq;
-using Shared;
-using Shared.Common;
-using Shared.Phone;
-using Shared.R;
-using ZigBee.Device;
-
-namespace Shared.Phone.Device.Logic
-{
-    public class LogicDevicePage : FrameLayout
-    {
-
-        public LogicDevicePage()
-        {
-            Tag = "Logic";
-        }
-        Button roombjButton = new Button();
-        Button roomTextButton = new Button();
-        Button devicetypeButton = new Button();
-        VerticalScrolViewLayout middle;
-        FrameLayout clickframeLayout = new FrameLayout();
-        Button clickbutton = new Button();
-        Button clicktextcolcrbutton = new Button();
-        public void Show()
-        {
-            UserView.HomePage.Instance.ScrollEnabled = false;
-            this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(160),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.devicestate,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var foolrname = new Button
-            {
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterRight,
-                X = Application.GetRealWidth(1080 - 400 - 120),
-                Width = Application.GetRealWidth(400),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                //TextID = MyInternationalizationString.customroom,
-                Text = Config.Instance.Home.GetCurrentFloorName,
-                TextSize = 14,
-            };
-            topRowLayout.AddChidren(foolrname);
-            var dropdown = new Button
-            {
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterRight,
-                X = foolrname.Right,
-                Width = Application.GetRealWidth(72),
-                Height = Application.GetRealHeight(72),
-                Y = Application.GetRealHeight(92),
-                UnSelectedImagePath = "ZigeeLogic/drop-down.png",
-            };
-            topRowLayout.AddChidren(dropdown);
-            #endregion
-
-
-            ///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱
-            if (Common.Room.Lists.Count == 0)
-            {
-                return;
-            }
-            ///鎴块棿婊戝姩鎺т欢
-            var roomhorizontalScrol = new HorizontalScrolViewLayout()
-            {
-                Width = Application.GetRealWidth(1080 - 58),
-                Height = Application.GetRealHeight(200),
-                Y = topRowLayout.Bottom,
-                X = Application.GetRealWidth(58),
-            };
-            this.AddChidren(roomhorizontalScrol);
-
-            ///璁惧绫诲瀷婊戝姩鎺т欢
-            var devicetypehorizontalScrol = new HorizontalScrolViewLayout()
-            {
-                Width = Application.GetRealWidth(1080 - 58),
-                Height = Application.GetRealHeight(280),
-                Y = roomhorizontalScrol.Bottom,
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                X = Application.GetRealWidth(58),
-               // Radius = (uint)Application.GetRealHeight(50),
-
-            };
-            this.AddChidren(devicetypehorizontalScrol);
-            devicetypehorizontalScrol.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
-
-            middle = new VerticalScrolViewLayout();
-            middle.Y = devicetypehorizontalScrol.Bottom + Application.GetRealHeight(40);
-            middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-            middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
-            middle.X = Application.GetRealWidth(58);
-            //middle.Radius = (uint)Application.GetRealHeight(50);
-            this.AddChidren(middle);
-            middle.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
-
-            ///鐩墠鏀寔鐨勮澶�
-            List<DeviceType> deviceTypeList = new List<DeviceType> {
-                DeviceType.OnOffOutput,
-                DeviceType.DimmableLight,
-                DeviceType.WindowCoveringDevice,
-                DeviceType.Thermostat,
-                DeviceType.AirSwitch,
-            };
-
-
-
-            ///妤煎眰鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> foorlclick = (sender, e) =>
-            {
-
-                var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                this.AddChidren(flMain);
-                flMain.MouseUpEventHandler += (sender2, e2) =>
-                {
-                    flMain.RemoveFromParent();
-                };
-                var foolrbjicon = new FrameLayout
-                {
-
-                    Width = Application.GetRealWidth(450),
-                    Height = Application.GetRealHeight(780),
-                    X = Application.GetRealWidth(1080 - 468 - 35),
-                    Y = Application.GetRealHeight(184),
-                    BackgroundImagePath = "Item/SelectFloor_Right.png",
-                };
-                flMain.AddChidren(foolrbjicon);
-
-                var btnfoolrtext = new Button
-                {
-                    Width = Application.GetRealWidth(450),
-                    Height = Application.GetRealHeight(150),
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    X = Application.GetRealWidth(80),
-                    TextID = MyInternationalizationString.selecfoolr,
-                    TextSize = 14,
-                };
-                foolrbjicon.AddChidren(btnfoolrtext);
-
-                var foolrbj = new VerticalScrolViewLayout
-                {
-
-                    Width = Application.GetRealWidth(450),
-                    Height = foolrbjicon.Height - btnfoolrtext.Height,
-                    X = Application.GetRealWidth(80),
-                    Y = btnfoolrtext.Bottom,
-                };
-                foolrbjicon.AddChidren(foolrbj);
-
-                foreach (var foolr in Config.Instance.Home.FloorDics)
-                {
-                    var foolrRowLayout = new RowLayout
-                    {
-                        Height = Application.GetRealHeight(150),
-                        LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-                    };
-                    foolrbj.AddChidren(foolrRowLayout);
-
-                    var btnfoolricon = new Button
-                    {
-                        Width = Application.GetRealWidth(81),
-                        Height = Application.GetRealHeight(81),
-                        UnSelectedImagePath = "Floor/Floor.png",
-                        Gravity = Gravity.CenterVertical,
-                    };
-                    foolrRowLayout.AddChidren(btnfoolricon);
-
-
-                    var btnfoolrname = new Button
-                    {
-                        Width = Application.GetRealWidth(250),
-                        Height = Application.GetRealHeight(150),
-                        Text = foolr.Value,
-                        TextAlignment = TextAlignment.CenterLeft,
-                        TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                        Tag = foolr.Key,
-                        X = btnfoolricon.Right + Application.GetRealWidth(12),
-                        TextSize = 14,
-                    };
-                    foolrRowLayout.AddChidren(btnfoolrname);
-                    if (foolrname.Text == foolr.Value)
-                    {
-                        btnfoolricon.UnSelectedImagePath = "Floor/FloorSelected.png";
-                        btnfoolrname.TextColor = ZigbeeColor.Current.LogicTextBlackColor;
-                    }
-
-                    EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) =>
-                    {
-                        roomhorizontalScrol.RemoveAll();
-                        devicetypehorizontalScrol.RemoveAll();
-                        middle.RemoveAll();
-                        foolrname.Text = btnfoolrname.Text;
-                        flMain.RemoveFromParent();
-                        var list = Send.GetRoomList(btnfoolrname.Tag.ToString());
-                        AllRoomView(list, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
-
-                    };
-                    foolrRowLayout.MouseUpEventHandler += foolrnameclick;
-                    btnfoolrname.MouseUpEventHandler += foolrnameclick;
-
-
-                }
-
-            };
-            foolrname.MouseUpEventHandler += foorlclick;
-            dropdown.MouseUpEventHandler += foorlclick;
-            ///绗竴娆¤繘鏉�
-            var roomlists = new List<Common.Room>();
-            roomlists.Clear();
-            if (Config.Instance.Home.FloorDics.Count < 2)
-            {
-                foolrname.Visible = false;
-                dropdown.Visible = false;
-                if (Config.Instance.Home.FloorDics.Count == 0)
-                {
-                    roomlists.AddRange(Common.Room.Lists);
-                }
-                else
-                {
-                    roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
-                }
-            }
-            else
-            {
-                roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
-
-            }
-
-
-            AllRoomView(roomlists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
-
-
-        }
-        /// <summary>
-        /// 鍔犺浇鎵�鏈夋埧闂寸殑瑙嗗浘鏂规硶
-        /// </summary>
-        void AllRoomView(List<Common.Room> roomlist, List<DeviceType> deviceTypeList, HorizontalScrolViewLayout roomhorizontalScrol, HorizontalScrolViewLayout devicetypehorizontalScrol)
-        {
-            for (int i = 0; i < roomlist.Count; i++)
-            {
-                var room = roomlist[i];
-                var fra = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(200),
-                    Width = Application.GetRealWidth(255),
-                };
-                roomhorizontalScrol.AddChidren(fra);
-
-                var roombjBtn = new Button
-                {
-                    Height = Application.GetRealHeight(158),
-                    Width = Application.GetRealWidth(255),
-                    UnSelectedImagePath = "ZigeeLogic/iconBackgroundColor.png",
-                    SelectedImagePath = "ZigeeLogic/iconSelectedBackgroundColor.png",
-                    Y = Application.GetRealHeight(21),
-                };
-                fra.AddChidren(roombjBtn);
-
-                var roomnameBtn = new Button
-                {
-
-                    Height = Application.GetRealHeight(152 - 26 - 20),
-                    Width = Application.GetRealWidth(255 - 20 - 50),
-                    Text = room.Name,
-                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                    SelectedTextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    Y = Application.GetRealHeight(21 + 13 + 10),
-                    X = Application.GetRealWidth(10 + 25),
-
-                };
-                fra.AddChidren(roomnameBtn);
-                if (i == 0)
-                {
-                    roombjButton.IsSelected = false;
-                    roombjButton = roombjBtn;
-                    roombjBtn.IsSelected = true;
-
-                    roomTextButton.IsSelected = false;
-                    roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
-                    var list = new List<DeviceUI>();
-                    foreach (var device in room.DeviceUIList)
-                    {
-                        if (device.CommonDevice == null)
-                        {
-                            continue;
-                        }
-                        if (!deviceTypeList.Contains(device.CommonDevice.Type))
-                        {
-                            continue;
-                        }
-                        list.Add(device);
-                    }
-                    if (list.Count == 0)
-                    {
-                        devicetypehorizontalScrol.Height = 0; 
-                        middle.Height = 0;
-                    }
-                    else
-                    {
-                        devicetypehorizontalScrol.Height = Application.GetRealHeight(280);
-                        middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-                    }
-                    AllDeviceTypeView(list, devicetypehorizontalScrol);
-
-                }
-
-
-                EventHandler<MouseEventArgs> roomclick = (sender, e) =>
-                {
-                    roombjButton.IsSelected = false;
-                    roombjButton = roombjBtn;
-                    roombjBtn.IsSelected = true;
-
-                    roomTextButton.IsSelected = false;
-                    roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
-                    var list = new List<DeviceUI>();
-                    foreach (var device in room.DeviceUIList)
-                    {
-                        if (device.CommonDevice == null)
-                        {
-                            continue;
-                        }
-                        if (!deviceTypeList.Contains(device.CommonDevice.Type))
-                        {
-                            continue;
-                        }
-                        list.Add(device);
-                    }
-                    if (list.Count == 0)
-                    {
-                        devicetypehorizontalScrol.Height = 0;
-                        middle.Height = 0;
-                    }
-                    else
-                    {
-                        devicetypehorizontalScrol.Height = Application.GetRealHeight(280);
-                        middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-                    }
-                    AllDeviceTypeView(list, devicetypehorizontalScrol);
-
-
-                };
-                roomnameBtn.MouseUpEventHandler += roomclick;
-                roombjBtn.MouseUpEventHandler += roomclick;
-
-            }
-        }
-
-        /// <summary>
-        ///鍔犺浇璇ュ尯鍩熸墍鏈夎澶囩殑瑙嗗浘鏂规硶
-        /// </summary>
-        void AllDeviceTypeView(List<DeviceUI> devicelist, HorizontalScrolViewLayout devicetypehorizontalScrol)
-        {
-
-            List<string> devicetypelist = new List<string>();
-            devicetypelist.Clear();
-
-            #region  ------鎺掑垪璁惧绫诲瀷------
-            var lightjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.DimmableLight || device.CommonDevice.Type == DeviceType.OnOffOutput);
-            if (lightjosn != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Lights));
-            }
-            var curtainjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.WindowCoveringDevice);
-            if (curtainjosn != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains));
-            }
-            var ac = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.Thermostat);
-            if (ac != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.AC));
-            }
-            var airSwitch = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.AirSwitch);
-            if (airSwitch != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Airswitch));
-            }
-
-            #endregion
-
-            devicetypehorizontalScrol.RemoveAll();
-            for (int i = 0; i < devicetypelist.Count; i++)
-            {
-
-                var devicetype = devicetypelist[i];
-
-                var spaceRowLayout = new FrameLayout();
-                devicetypehorizontalScrol.AddChidren(spaceRowLayout);
-                if (i == 0)
-                {
-                    spaceRowLayout.Width = Application.GetRealWidth(37);
-                }
-                else
-                {
-                    spaceRowLayout.Width = Application.GetRealWidth(80);
-                }
-
-                var deviceRowLayout = new FrameLayout
-                {
-                    Width = Application.GetRealWidth(156 + 20),
-                    Height = Application.GetRealHeight(280 - 30),
-                    Y = Application.GetRealHeight(30),
-                };
-                devicetypehorizontalScrol.AddChidren(deviceRowLayout);
-
-                var backgroundColor = new Button
-                {
-                    Width = Application.GetRealWidth(156),
-                    Height = Application.GetRealHeight(180),
-                    X = Application.GetRealWidth(10),
-                    UnSelectedImagePath = "ZigeeLogic/deviceunselectedbackgroundcolor.png",
-                    SelectedImagePath = "ZigeeLogic/deviceselectedbackgroundcolor.png",
-                };
-                deviceRowLayout.AddChidren(backgroundColor);
-
-
-                var devicetypeicon = new Button
-                {
-                    Width = Application.GetRealWidth(84),
-                    Height = Application.GetRealHeight(84),
-                    X = Application.GetRealWidth(46),
-                    Y = Application.GetRealHeight(30),
-                };
-                deviceRowLayout.AddChidren(devicetypeicon);
-
-                var devicetypename = new Button
-                {
-                    Width = Application.GetRealWidth(176),
-                    Height = Application.GetRealHeight(40),
-                    Text = devicetype,
-                    TextAlignment = TextAlignment.Center,
-                    Y = backgroundColor.Bottom,
-                    TextColor = ZigbeeColor.Current.LogicAddColor,
-                    TextSize = 10,
-                };
-                deviceRowLayout.AddChidren(devicetypename);
-                if (devicetype == Language.StringByID(MyInternationalizationString.Lights))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedlight.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.Curtains))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedcurtain.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.AC))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedac.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.Airswitch))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedairswitch.png";
-                }
-                EventHandler<MouseEventArgs> devicetypeclick = (sender13, e13) =>
-                {
-
-                    devicetypeButton.IsSelected = false;
-                    devicetypeButton = backgroundColor;
-                    backgroundColor.IsSelected = true;
-                    List<DeviceType> list = new List<DeviceType>();
-                    list.Clear();
-                    ///鍒嗙被鏄剧ず锛堜緥濡傜伅鍏夛細{鐏厜1锛岀伅鍏�2...}锛�
-                    if (devicetype == Language.StringByID(MyInternationalizationString.Lights))
-                    {
-                        list.Add(DeviceType.OnOffOutput);//0x0101鍗佽繘鍒�257
-                        list.Add(DeviceType.DimmableLight);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.Curtains))
-                    {
-                        list.Add(DeviceType.WindowCoveringDevice);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.AC))
-                    {
-                        list.Add(DeviceType.Thermostat);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.Airswitch))
-                    {
-                        list.Add(DeviceType.AirSwitch);
-                    }
-
-                    ActionDeviceView(list, devicelist);
-
-                };
-                deviceRowLayout.MouseUpEventHandler += devicetypeclick;
-                devicetypename.MouseUpEventHandler += devicetypeclick;
-                devicetypeicon.MouseUpEventHandler += devicetypeclick;
-                backgroundColor.MouseUpEventHandler += devicetypeclick;
-
-            }
-            ///鏄剧ず鎴块棿鎵�鏈夎澶�
-            ActionDeviceView(new List<DeviceType>(), devicelist);
-        }
-        /// <summary>
-        /// 鍔犺浇璇ョ被鍨嬭澶囪鍥炬柟娉�
-        /// </summary>
-        /// <param name="devicelist">璁惧鍒楄〃</param>
-        void ActionDeviceView(List<DeviceType> deviceTypelist, List<DeviceUI> devicelist)
-        {
-            middle.RemoveAll();
-            foreach (var common in devicelist)
-            {
-
-                if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.CommonDevice.Type))
-                {
-                    continue;
-                }
-
-                var deviceFramelayout = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(160),
-                };
-                middle.AddChidren(deviceFramelayout);
-
-                var bjFramelayout = new FrameLayout
-                {
-                    Width = Application.GetRealWidth(112),
-                    Height = Application.GetRealHeight(112),
-                    X = Application.GetRealWidth(58),
-                    Y = Application.GetRealHeight(30 + 9),
-                    Radius = (uint)Application.GetRealHeight(56),
-                    BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-                };
-                deviceFramelayout.AddChidren(bjFramelayout);
-
-                var deviceIconBtn = new Button
-                {
-                    Width = Application.GetRealWidth(82),
-                    Height = Application.GetRealHeight(82),
-                    Gravity = Gravity.Center,
-
-                };
-                bjFramelayout.AddChidren(deviceIconBtn);
-
-                var deviceRow = new RowLayout
-                {
-                    Y = Application.GetRealHeight(30),
-                    Width = Application.GetRealWidth(850),
-                    Height = Application.GetRealHeight(130),
-                    X = Application.GetRealWidth(176 + 10),
-                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-
-                };
-                deviceFramelayout.AddChidren(deviceRow);
-
-                var devicename = new Button
-                {
-                    Text = common.CommonDevice.DeviceEpointName,
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    SelectedTextColor = ZigbeeColor.Current.LogicAddColor,
-                    TextSize = 14,
-                };
-                deviceRow.AddChidren(devicename);
-                switch (common.CommonDevice.Type)
-                {
-
-                    case DeviceType.OnOffOutput:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/light.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedlight.png";
-                        }
-                        break;
-                    case DeviceType.DimmableLight:
-                        {
-
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/dimmableLight.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selecteddimmableLight.png";
-                        }
-                        break;
-                    case DeviceType.WindowCoveringDevice:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/curtain.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedcurtain.png";
-                        }
-                        break;
-                    case DeviceType.Thermostat:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/ac.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedac.png";
-                        }
-                        break;
-                    case DeviceType.AirSwitch:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/airswitch.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedairswitch.png";
-                        }
-                        break;
-                }
-
-                EventHandler<MouseEventArgs> devicclick = (sen, e) =>
-                {
-                    clickbutton.IsSelected = false;
-                    clickbutton = deviceIconBtn;
-                    deviceIconBtn.IsSelected = true;
-                    clickframeLayout.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-                    clickframeLayout = bjFramelayout;
-                    bjFramelayout.BackgroundColor = ZigbeeColor.Current.LogicIconBackgroundColor;
-                    clicktextcolcrbutton.IsSelected = false;
-                    clicktextcolcrbutton = devicename;
-                    devicename.IsSelected = true;
-
-                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                    this.AddChidren(flMain);
-                    CurrentDeviceStateView(flMain, common.CommonDevice, false);
-                };
-                deviceFramelayout.MouseUpEventHandler += devicclick;
-                bjFramelayout.MouseUpEventHandler += devicclick;
-                deviceIconBtn.MouseUpEventHandler += devicclick;
-                deviceRow.MouseUpEventHandler += devicclick;
-                devicename.MouseUpEventHandler += devicclick;
-
-            }
-        }
-        /// <summary>
-        /// 閫変腑璇ヨ澶囧姛鑳戒綔涓烘潯浠剁殑瑙嗗浘鏂规硶
-        /// </summary>
-        /// <param name="common">Common.</param>
-        public static void CurrentDeviceStateView(FrameLayout flMain, CommonDevice common, bool edit)
-        {
-            //涓嶈褰撳墠鐣岄潰婊戝姩
-            UserView.HomePage.Instance.ScrollEnabled = false;
-            Dictionary<string, object> actionsInfo = new Dictionary<string, object>();
-            List<Dictionary<string, string>> taskListInfo = new List<Dictionary<string, string>>();
-            //var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-            //this.AddChidren(flMain);
-            flMain.MouseUpEventHandler += (sender, e) =>
-            {
-                flMain.RemoveFromParent();
-            };
-
-            var devicefra = new FrameLayout
-            {
-
-                Width = Application.GetRealWidth(1080),
-                Height = Application.GetRealHeight(530 + 160),
-                Y = Application.GetRealHeight(1920 - 530 - 160),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                //Radius = (uint)Application.GetRealHeight(60),
-            };
-            flMain.AddChidren(devicefra);
-            devicefra.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
-
-            #region  -------鍙栨秷   瀹屾垚
-            var timetype = new RowLayout
-            {
-                Height = Application.GetRealHeight(140),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            devicefra.AddChidren(timetype);
-            var Btncancel = new Button
-            {
-                TextID = MyInternationalizationString.cancel,
-                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                X = Application.GetRealWidth(80),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextSize = 14,
-
-            };
-            timetype.AddChidren(Btncancel);
-            Btncancel.MouseUpEventHandler += (sender16, e16) =>
-            {
-                flMain.RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var Btntitle = new Button
-            {
-                TextID = MyInternationalizationString.security,
-                TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(420),
-                TextAlignment = TextAlignment.Center,
-                X = Btncancel.Right + Application.GetRealWidth(50),
-                TextSize = 16,
-                Text = common.DeviceEpointName,
-            };
-            timetype.AddChidren(Btntitle);
-            var Btncomplete = new Button
-            {
-                TextID = MyInternationalizationString.complete,
-                TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                TextAlignment = TextAlignment.CenterRight,
-                X = Btntitle.Right + Application.GetRealWidth(50),
-                TextSize = 14,
-
-            };
-            timetype.AddChidren(Btncomplete);
-            #endregion
-
-
-            string SelectedDeviceStatusaction = "no";
-            actionsInfo.Add("LinkType", 0);
-            actionsInfo.Add("DeviceAddr", common.DeviceAddr);
-            actionsInfo.Add("Epoint", common.DeviceEpoint);
-            actionsInfo.Add("Time", 0);
-            actionsInfo.Add("TaskList", taskListInfo);
-
-            List<Dictionary<string, string>> TaskList = null;
-            if (edit)
-            {
-                foreach (var deviceinfo in Common.Logic.CurrentLogic.Actions)
-                {
-                    if (deviceinfo["LinkType"].ToString() == "0")
-                    {
-
-                        if (deviceinfo["DeviceAddr"].ToString() == common.DeviceAddr && deviceinfo["Epoint"].ToString() == common.DeviceEpoint.ToString())
-                        {
-                            TaskList = deviceinfo["TaskList"] as List<Dictionary<string, string>>;
-                            break;
-                        }
-                    }
-                }
-            }
-            switch (common.Type)
-            {
-                
-                ///鐏厜
-                case DeviceType.OnOffOutput:
-                    {
-
-                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                        Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
-                        if (switchdictionary.ContainsKey("TaskType"))
-                        {
-                            switchdictionary.Remove("TaskType");
-                        }
-                        if (switchdictionary.ContainsKey("Data1"))
-                        {
-                            switchdictionary.Remove("Data1");
-                        }
-                        if (switchdictionary.ContainsKey("Data2"))
-                        {
-                            switchdictionary.Remove("Data2");
-                        }
-                        switchdictionary.Add("TaskType", "1");
-                        switchdictionary.Add("Data1", "0");
-                        switchdictionary.Add("Data2", "0");
-                        taskListInfo.Add(switchdictionary);
-
-                        #endregion
-
-                        #region  鐏厜View
-
-                        #region 寮�
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-                        #endregion
-                        #region  鍏�
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = openframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-                        #endregion
-                        #region   鍙栧弽
-                        var takebackframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = closeframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(takebackframelayout);
-                        var takebackrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        takebackframelayout.AddChidren(takebackrowlayout);
-
-                        var btntakeback = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.onoff,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        takebackrowlayout.AddChidren(btntakeback);
-
-                        var takebackBtnSelected = new SelectedButton();
-                        takebackrowlayout.AddChidren(takebackBtnSelected);
-
-                        #endregion
-
-
-                        #endregion
-
-                        ///纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            takebackBtnSelected.Visible = false;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("Data1", "1");//榛樿鍊�
-
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-                        ///鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-                            takebackBtnSelected.Visible = false;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("Data1", "0");//榛樿鍊�
-
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-                        //鍙栧弽
-                        EventHandler<MouseEventArgs> takebackclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = false;
-                            takebackBtnSelected.Visible = true;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("Data1", "2");//榛樿鍊�
-
-                        };
-                        takebackrowlayout.MouseUpEventHandler += takebackclick;
-                        btntakeback.MouseUpEventHandler += takebackclick;
-                        takebackBtnSelected.MouseUpEventHandler += takebackclick;
-                        takebackframelayout.MouseUpEventHandler += takebackclick;
-                        if (edit && TaskList != null)
-                        {
-                            foreach (var value in TaskList)
-                            {
-                                if (value["TaskType"] == "1")
-                                {
-                                    if (switchdictionary.ContainsKey("Data1"))
-                                    {
-                                        switchdictionary.Remove("Data1");
-                                    }
-                                    if (value["Data1"] == "1")
-                                    {
-                                        switchdictionary.Add("Data1", "1");
-                                        openBtnSelected.Visible = true;
-                                        closeBtnSelected.Visible = false;
-                                        takebackBtnSelected.Visible = false;
-                                    }
-                                    else if (value["Data1"] == "0")
-                                    {
-                                        switchdictionary.Add("Data1", "0");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = true;
-                                        takebackBtnSelected.Visible = false;
-                                    }
-                                    else if (value["Data1"] == "2")
-                                    {
-                                        switchdictionary.Add("Data1", "2");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = false;
-                                        takebackBtnSelected.Visible = true;
-                                    }
-                                    break;
-                                }
-
-                            }
-                        }
-
-                    }
-                    break;
-                ///璋冨厜鐏厜
-                case DeviceType.DimmableLight:
-                    {
-
-                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                        Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
-                        if (switchdictionary.ContainsKey("Data2"))
-                        {
-                            switchdictionary.Remove("Data2");
-                        }
-                        switchdictionary.Add("Data2", "0");
-                        taskListInfo.Add(switchdictionary);
-
-                        #endregion
-
-                        #region  鐏厜View
-
-                        devicefra.Y = Application.GetRealHeight(1920 - 160 * 3 - 210 - 160);
-                        devicefra.Height = Application.GetRealHeight(160 * 3 + 210 + 160);
-
-                        #region 寮�
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160 + 160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-
-                        var horizontalSeekBarRow = new RowLayout
-                        {
-                            Y = openrowlayout.Bottom,
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(160),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(horizontalSeekBarRow);
-                        var horizontalSeekBarVol = new DiyImageSeekBar
-                        {
-                            Y = openrowlayout.Bottom,
-                            X = Application.GetRealWidth(80),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(160),
-                            IsProgressTextShow = true,//鏄剧ず鐧惧垎姣�
-                            IsClickable = false,//杩涘害鏉℃槸鍚︽粦鍔�
-                            ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//閫変腑杩涘害鏉¢鑹�
-                            ThumbImagePath = "ZigeeLogic/progressbtn2.png",//杩涘害鏉℃寜閽浘鏍�
-                            ThumbImageHeight = Application.GetRealHeight(56),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
-                            ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                            ProgressTextSize = 12,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏� 
-                            SeekBarViewHeight = Application.GetRealHeight(10),//杩涘害鏉$殑楂樺害
-
-                        };
-                        openframelayout.AddChidren(horizontalSeekBarVol);
-                         #endregion
-
-                        #region  鍏�
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = openframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-                        #endregion
-
-                        #region   鍙栧弽
-                        var takebackframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = closeframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(takebackframelayout);
-                        var takebackrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        takebackframelayout.AddChidren(takebackrowlayout);
-
-                        var btntakeback = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.onoff,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        takebackrowlayout.AddChidren(btntakeback);
-
-                        var takebackBtnSelected = new SelectedButton();
-                        takebackrowlayout.AddChidren(takebackBtnSelected);
-
-                        #endregion
-
-
-                        #endregion
-
-                        int Progressvalue = 100;
-                        EventHandler<int> progressclick = (sender, e) =>
-                         {
-                             SelectedDeviceStatusaction = "yes";
-                             Progressvalue = horizontalSeekBarVol.Progress;
-                             if (switchdictionary.ContainsKey("TaskType"))
-                             {
-                                 switchdictionary.Remove("TaskType");
-                             }
-                             if (switchdictionary.ContainsKey("Data1"))
-                             {
-                                 switchdictionary.Remove("Data1");
-                             }
-                             switchdictionary.Add("TaskType", "3");
-                            //鏈�澶т寒搴﹀�兼槸254闇�瑕佽浆鎹紱
-                            var lightbrightnessvalue = (254 * horizontalSeekBarVol.Progress) / 100;
-                             switchdictionary.Add("Data1", lightbrightnessvalue.ToString());
-
-                         };
-                        horizontalSeekBarVol.OnProgressChangedEvent += progressclick;
-                        horizontalSeekBarVol.OnStopTrackingTouchEvent += progressclick;
-                        ///纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsClickable = true;
-                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected;
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            takebackBtnSelected.Visible = false;
-                            horizontalSeekBarVol.Progress = Progressvalue;
-                            if (switchdictionary.ContainsKey("TaskType"))
-                            {
-                                switchdictionary.Remove("TaskType");
-                            }
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("TaskType", "3");
-                            //鏈�澶т寒搴﹀�兼槸254闇�瑕佽浆鎹紱
-                            var lightbrightnessvalue = (254 * horizontalSeekBarVol.Progress) / 100;
-                            switchdictionary.Add("Data1", lightbrightnessvalue.ToString());
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-                        ///鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsClickable = false;
-                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-                            takebackBtnSelected.Visible = false;
-                            if (switchdictionary.ContainsKey("TaskType"))
-                            {
-                                switchdictionary.Remove("TaskType");
-                            }
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("TaskType", "1");
-                            switchdictionary.Add("Data1", "0");//榛樿鍊�
-
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-                        //鍙栧弽
-                        EventHandler<MouseEventArgs> takebackclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsClickable = false;
-                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = false;
-                            takebackBtnSelected.Visible = true;
-                            if (switchdictionary.ContainsKey("TaskType"))
-                            {
-                                switchdictionary.Remove("TaskType");
-                            }
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("TaskType", "1");
-                            switchdictionary.Add("Data1", "2");//榛樿鍊�
-
-                        };
-                        takebackrowlayout.MouseUpEventHandler += takebackclick;
-                        btntakeback.MouseUpEventHandler += takebackclick;
-                        takebackBtnSelected.MouseUpEventHandler += takebackclick;
-                        takebackframelayout.MouseUpEventHandler += takebackclick;
-
-                        if (edit && TaskList != null)
-                        {
-                            foreach (var value in TaskList)
-                            {
-                                if (switchdictionary.ContainsKey("Data1"))
-                                {
-                                    switchdictionary.Remove("Data1");
-                                }
-                                if (switchdictionary.ContainsKey("TaskType"))
-                                {
-                                    switchdictionary.Remove("TaskType");
-                                }
-                                if (value["TaskType"] == "1")
-                                {
-                                    switchdictionary.Add("TaskType", "1");
-                                    if (value["Data1"] == "0")
-                                    {
-                                        switchdictionary.Add("Data1", "0");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = true;
-                                        takebackBtnSelected.Visible = false;
-                                        horizontalSeekBarVol.IsClickable = false;
-                                        horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
-                                    }
-                                    else if (value["Data1"] == "2")
-                                    {
-                                        switchdictionary.Add("Data1", "2");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = false;
-                                        takebackBtnSelected.Visible = true;
-                                        horizontalSeekBarVol.IsClickable = false;
-                                        horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
-                                    }
-
-                                }
-                                else if (value["TaskType"] == "3")
-                                {
-                                    switchdictionary.Add("TaskType", "3");
-                                    switchdictionary.Add("Data1", value["Data1"]);
-                                    openBtnSelected.Visible = true;
-                                    closeBtnSelected.Visible = false;
-                                    takebackBtnSelected.Visible = false;
-                                    horizontalSeekBarVol.IsClickable = true;
-                                    horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected;
-                                    horizontalSeekBarVol.Progress = int.Parse(value["Data1"])*100/254;
-                                    Progressvalue = horizontalSeekBarVol.Progress;
-
-                                }
-                                break;
-
-                            }
-                        }
-
-                    }
-                    break;
-                ///绐楀笜
-                case DeviceType.WindowCoveringDevice:
-                    {
-                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                        Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
-                        if (switchdictionary.ContainsKey("TaskType"))
-                        {
-                            switchdictionary.Remove("TaskType");
-                        }
-                        switchdictionary.Add("TaskType", "6");
-
-                        taskListInfo.Add(switchdictionary);
-
-                        #endregion
-                        devicefra.Y = Application.GetRealHeight(1920 - 160 * 2 - 210 - 160);
-                        devicefra.Height = Application.GetRealHeight(160 * 2 + 210 + 160);
-                        #region 绐楀笜View
-
-                        #region 寮�
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160 + 160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-
-
-                        var horizontalSeekBarRow = new RowLayout
-                        {
-                            Y = openrowlayout.Bottom,
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(160),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(horizontalSeekBarRow);
-                        var horizontalSeekBarVol = new DiyImageSeekBar
-                        {
-                            Y = openrowlayout.Bottom,
-                            X = Application.GetRealWidth(80),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(160),
-                            IsProgressTextShow = true,//鏄剧ず鐧惧垎姣�
-                            IsClickable = false,//杩涘害鏉℃槸鍚︽粦鍔�
-                            ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected,//閫変腑杩涘害鏉¢鑹�
-                            ThumbImagePath = "ZigeeLogic/progressbtn2.png",//杩涘害鏉℃寜閽浘鏍�
-                            ThumbImageHeight = Application.GetRealHeight(56),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
-                            ProgressTextColor = ZigbeeColor.Current.LogicBtnCancelColor,//杩涘害鏉″師棰滆壊
-                            ProgressTextSize = 12,//鏄剧ず鐧惧垎姣斿瓧浣撳ぇ灏� 
-                            SeekBarViewHeight = Application.GetRealHeight(10),
-                        };
-                        openframelayout.AddChidren(horizontalSeekBarVol);
-
-                        #endregion
-
-                        #region  鍏�
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = openframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-                        #endregion
-
-
-
-                        #endregion
-                        int Progressvalue = 100;
-
-                        EventHandler<int> progressclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            Progressvalue = horizontalSeekBarVol.Progress;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            if (switchdictionary.ContainsKey("Data2"))
-                            {
-                                switchdictionary.Remove("Data2");
-                            }
-                            switchdictionary.Add("Data1", "5");
-                            switchdictionary.Add("Data2", horizontalSeekBarVol.Progress.ToString());
-
-                        };
-                        horizontalSeekBarVol.OnProgressChangedEvent += progressclick;
-                        horizontalSeekBarVol.OnStopTrackingTouchEvent += progressclick;
-                        ///纭浜嬩欢
-                        EventHandler <MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsClickable = true;
-                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected;
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            horizontalSeekBarVol.Progress = Progressvalue;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            if (switchdictionary.ContainsKey("Data2"))
-                            {
-                                switchdictionary.Remove("Data2");
-                            }
-                            switchdictionary.Add("Data1", "5");
-                            switchdictionary.Add("Data2", horizontalSeekBarVol.Progress.ToString());
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-                        ///鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsClickable = false;
-                            horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            if (switchdictionary.ContainsKey("Data2"))
-                            {
-                                switchdictionary.Remove("Data2");
-                            }
-                            switchdictionary.Add("Data2", "0");
-                            switchdictionary.Add("Data1", "1");//榛樿鍊�
-
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-
-
-
-                        if (edit && TaskList != null)
-                        {
-                            foreach (var value in TaskList)
-                            {
-                                if (value["TaskType"] == "6")
-                                {
-                                    if (value["Data1"] == "5")
-                                    {
-                                        if (switchdictionary.ContainsKey("Data1"))
-                                        {
-                                            switchdictionary.Remove("Data1");
-                                        }
-                                        if (switchdictionary.ContainsKey("Data2"))
-                                        {
-                                            switchdictionary.Remove("Data2");
-                                        }
-                                        switchdictionary.Add("Data1", "5");
-                                        switchdictionary.Add("Data2", value["Data2"]);
-                                        horizontalSeekBarVol.IsClickable = true;
-                                        horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColorSelected;
-                                        openBtnSelected.Visible = true;
-                                        closeBtnSelected.Visible = false;
-                                        horizontalSeekBarVol.Progress = int.Parse(value["Data2"]);
-                                        Progressvalue = horizontalSeekBarVol.Progress;
-                                    }
-                                    else if (value["Data1"] == "1")
-                                    {
-                                        if (switchdictionary.ContainsKey("Data1"))
-                                        {
-                                            switchdictionary.Remove("Data1");
-                                        }
-                                        switchdictionary.Add("Data1", "1");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = true;
-                                        horizontalSeekBarVol.IsClickable = false;
-                                        horizontalSeekBarVol.ProgressBarColor = ZigbeeColor.Current.LogicProgressColor;
-                                    }
-
-                                }
-
-                            }
-                        }
-                    }
-                    break;
-                ///绌烘皵寮�鍏�
-                case DeviceType.AirSwitch: {
-                        {
-
-                            #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                            Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
-                            if (switchdictionary.ContainsKey("TaskType"))
-                            {
-                                switchdictionary.Remove("TaskType");
-                            }
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            if (switchdictionary.ContainsKey("Data2"))
-                            {
-                                switchdictionary.Remove("Data2");
-                            }
-                            switchdictionary.Add("TaskType", "1");
-                            switchdictionary.Add("Data1", "0");
-                            switchdictionary.Add("Data2", "0");
-                            taskListInfo.Add(switchdictionary);
-
-                            #endregion
-
-                            #region  绌烘皵鐏厜View
-
-                            #region 寮�
-
-                            var openframelayout = new FrameLayout
-                            {
-                                Height = Application.GetRealHeight(160),
-                                Y = timetype.Bottom + Application.GetRealHeight(20),
-                            };
-                            devicefra.AddChidren(openframelayout);
-
-                            var openrowlayout = new RowLayout
-                            {
-                                Y = Application.GetRealHeight(30),
-                                Width = Application.GetRealWidth(920),
-                                Height = Application.GetRealHeight(130),
-                                X = Application.GetRealWidth(80),
-                                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                            };
-                            openframelayout.AddChidren(openrowlayout);
-
-                            var btnopen = new Button
-                            {
-                                Width = Application.GetRealWidth(600),
-                                TextID = MyInternationalizationString.open,
-                                TextAlignment = TextAlignment.CenterLeft,
-                                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                                TextSize = 14,
-                            };
-                            openrowlayout.AddChidren(btnopen);
-
-                            var openBtnSelected = new SelectedButton();
-                            openrowlayout.AddChidren(openBtnSelected);
-                            #endregion
-                            #region  鍏�
-                            var closeframelayout = new FrameLayout
-                            {
-                                Height = Application.GetRealHeight(160),
-                                Y = openframelayout.Bottom,
-                            };
-                            devicefra.AddChidren(closeframelayout);
-                            var closerowlayout = new RowLayout
-                            {
-                                Y = Application.GetRealHeight(30),
-                                Width = Application.GetRealWidth(920),
-                                Height = Application.GetRealHeight(130),
-                                X = Application.GetRealWidth(80),
-                                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                            };
-                            closeframelayout.AddChidren(closerowlayout);
-
-                            var btnclose = new Button
-                            {
-                                //Text = "鍏�",
-                                TextID = MyInternationalizationString.close,
-                                Width = Application.GetRealWidth(600),
-                                TextAlignment = TextAlignment.CenterLeft,
-                                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                                TextSize = 14,
-                            };
-                            closerowlayout.AddChidren(btnclose);
-
-                            var closeBtnSelected = new SelectedButton();
-                            closerowlayout.AddChidren(closeBtnSelected);
-                            #endregion
-                            #region   鍙栧弽
-                            var takebackframelayout = new FrameLayout
-                            {
-                                Height = Application.GetRealHeight(160),
-                                Y = closeframelayout.Bottom,
-                            };
-                            devicefra.AddChidren(takebackframelayout);
-                            var takebackrowlayout = new RowLayout
-                            {
-                                Y = Application.GetRealHeight(30),
-                                Width = Application.GetRealWidth(920),
-                                Height = Application.GetRealHeight(130),
-                                X = Application.GetRealWidth(80),
-                                LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                            };
-                            takebackframelayout.AddChidren(takebackrowlayout);
-
-                            var btntakeback = new Button
-                            {
-                                //Text = "鍏�",
-                                TextID = MyInternationalizationString.onoff,
-                                Width = Application.GetRealWidth(600),
-                                TextAlignment = TextAlignment.CenterLeft,
-                                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                                TextSize = 14,
-                            };
-                            takebackrowlayout.AddChidren(btntakeback);
-
-                            var takebackBtnSelected = new SelectedButton();
-                            takebackrowlayout.AddChidren(takebackBtnSelected);
-
-                            #endregion
-
-
-                            #endregion
-
-                            ///纭浜嬩欢
-                            EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                            {
-                                SelectedDeviceStatusaction = "yes";
-                                openBtnSelected.Visible = true;
-                                closeBtnSelected.Visible = false;
-                                takebackBtnSelected.Visible = false;
-                                if (switchdictionary.ContainsKey("Data1"))
-                                {
-                                    switchdictionary.Remove("Data1");
-                                }
-                                switchdictionary.Add("Data1", "1");//榛樿鍊�
-
-
-                            };
-                            openrowlayout.MouseUpEventHandler += openclick;
-                            btnopen.MouseUpEventHandler += openclick;
-                            openBtnSelected.MouseUpEventHandler += openclick;
-                            openframelayout.MouseUpEventHandler += openclick;
-                            ///鍙栨秷浜嬩欢
-                            EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                            {
-                                SelectedDeviceStatusaction = "yes";
-                                openBtnSelected.Visible = false;
-                                closeBtnSelected.Visible = true;
-                                takebackBtnSelected.Visible = false;
-                                if (switchdictionary.ContainsKey("Data1"))
-                                {
-                                    switchdictionary.Remove("Data1");
-                                }
-                                switchdictionary.Add("Data1", "0");//榛樿鍊�
-
-                            };
-                            closerowlayout.MouseUpEventHandler += closeclick;
-                            btnclose.MouseUpEventHandler += closeclick;
-                            closeBtnSelected.MouseUpEventHandler += closeclick;
-                            closeframelayout.MouseUpEventHandler += closeclick;
-                            //鍙栧弽
-                            EventHandler<MouseEventArgs> takebackclick = (sender, e) =>
-                            {
-                                SelectedDeviceStatusaction = "yes";
-                                openBtnSelected.Visible = false;
-                                closeBtnSelected.Visible = false;
-                                takebackBtnSelected.Visible = true;
-                                if (switchdictionary.ContainsKey("Data1"))
-                                {
-                                    switchdictionary.Remove("Data1");
-                                }
-                                switchdictionary.Add("Data1", "2");//榛樿鍊�
-
-                            };
-                            takebackrowlayout.MouseUpEventHandler += takebackclick;
-                            btntakeback.MouseUpEventHandler += takebackclick;
-                            takebackBtnSelected.MouseUpEventHandler += takebackclick;
-                            takebackframelayout.MouseUpEventHandler += takebackclick;
-                            if (edit && TaskList != null)
-                            {
-                                foreach (var value in TaskList)
-                                {
-                                    if (value["TaskType"] == "1")
-                                    {
-                                        if (switchdictionary.ContainsKey("Data1"))
-                                        {
-                                            switchdictionary.Remove("Data1");
-                                        }
-                                        if (value["Data1"] == "1")
-                                        {
-                                            switchdictionary.Add("Data1", "1");
-                                            openBtnSelected.Visible = true;
-                                            closeBtnSelected.Visible = false;
-                                            takebackBtnSelected.Visible = false;
-                                        }
-                                        else if (value["Data1"] == "0")
-                                        {
-                                            switchdictionary.Add("Data1", "0");
-                                            openBtnSelected.Visible = false;
-                                            closeBtnSelected.Visible = true;
-                                            takebackBtnSelected.Visible = false;
-                                        }
-                                        else if (value["Data1"] == "2")
-                                        {
-                                            switchdictionary.Add("Data1", "2");
-                                            openBtnSelected.Visible = false;
-                                            closeBtnSelected.Visible = false;
-                                            takebackBtnSelected.Visible = true;
-                                        }
-                                        break;
-                                    }
-
-                                }
-                            }
-
-                        }
-                    }
-                    break;
-                ///绌鸿皟
-                case DeviceType.Thermostat:
-                    {
-
-                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                       var temperaturedictionary = new Dictionary<string, string>();
-                       var modedictionary = new Dictionary<string, string>();
-                        var speeddictionary = new Dictionary<string, string>();
-                        dictionary(temperaturedictionary, "TaskType", "5");
-                        dictionary(modedictionary, "TaskType", "5");
-                        dictionary(modedictionary, "Data1", "3");
-                        dictionary(speeddictionary, "TaskType", "5");
-                        dictionary(speeddictionary, "Data1", "6");
-                        taskListInfo.Add(temperaturedictionary);
-                        taskListInfo.Add(modedictionary);
-                        taskListInfo.Add(speeddictionary);
-                        #endregion
-                        #region  绌鸿皟View
-
-                        devicefra.Y = Application.GetRealHeight(1920 - 600 - 210 - 160*2);
-                        devicefra.Height = Application.GetRealHeight(600+ 210 + 160*2);
-
-                        #region 寮�
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-                        #endregion
-
-                        #region  绌鸿皟鐘舵�乂iew
-                        var PickerViewfra = new FrameLayout
-                        {
-                            Y = openframelayout.Bottom,
-                            Height = Application.GetRealHeight(600),
-                        };
-                        devicefra.AddChidren(PickerViewfra);
-
-                        //閬尅绌鸿皟婊戝姩view锛�
-                        var pausePickerViewfra= new FrameLayout
-                        {
-                            Y = openframelayout.Bottom,
-                            Height = Application.GetRealHeight(600),
-                            BackgroundColor=0x60ffffff,
-                        };
-                        devicefra.AddChidren(pausePickerViewfra);
-
-
-
-                        var mUIPickerView = new UIPickerView
-                        {
-                            Height = Application.GetRealHeight(600-5),
-                        };
-                        PickerViewfra.AddChidren(mUIPickerView);
-                        var line = new Button
-                        {
-                            Y = Application.GetRealHeight(600-5),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(5),
-                            X = Application.GetRealWidth(80),
-                            BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        PickerViewfra.AddChidren(line);
-
-                        var mList1 = new List<string>();
-                        var mList2 = new List<string> {
-                         Language.StringByID(MyInternationalizationString.logiccool),
-                         Language.StringByID(MyInternationalizationString.logicheat),
-                         Language.StringByID(MyInternationalizationString.logicauto),
-                         Language.StringByID(MyInternationalizationString.logicdry),
-                         Language.StringByID(MyInternationalizationString.logicfanonly),
-                        };
-                        var mList3 = new List<string>{
-                         Language.StringByID(MyInternationalizationString.logiclow),
-                         Language.StringByID(MyInternationalizationString.logicmedium),
-                         Language.StringByID(MyInternationalizationString.logichigh),
-                          };
-                        for (int i = 16; i < 33; i++)
-                        {
-                            mList1.Add(i.ToString() +" " + "鈩�");
-                        }
-                        mUIPickerView.setNPicker(mList1, mList2, mList3);
-                        ///榛樿鐘舵��
-                       
-
-                        #endregion
-
-                        #region  鍏�
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = PickerViewfra.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-                        #endregion
-
-                        //榛樿26,鑷姩,涓
-                        int indextemperature = 10, indexmode = 2, indexspeed = 1;
-                        mUIPickerView.OnSelectChangeEvent += (s1, s2, s3) =>
-                        {
-                            indextemperature = s1;
-                            indexmode = s2;
-                            indexspeed = s3;
-                            if (openBtnSelected.Visible)
-                            {
-                                SelectedDeviceStatusaction = "yes";
-                                var temperature = mList1[s1].Split(' ')[0];
-                                var modestring = mList2[s2].Split(' ')[0];
-                                var speedstring = mList3[s3].Split(' ')[0];
-                                ModeState(modestring, temperaturedictionary, modedictionary);
-                                var a = int.Parse(temperature) * 100;
-                                dictionary(temperaturedictionary, "Data2", a.ToString());
-
-                                SpeedState(speedstring, speeddictionary);
-                            }
-                        };
-                       mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0);
-                        mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1);
-                        mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2);
-                        #endregion
-                       
-                        if (edit && TaskList != null)
-                        {
-                       
-                            foreach (var value in TaskList)
-                            {
-                                if (TaskList.Count == 1)
-                                {
-                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0);
-                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1);
-                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2);
-                                    //鏁扮粍鍙湁涓�涓厓绱犺鏄庡綋鍓嶇┖璋冪姸鎬佷负鍏筹紱
-                                    openBtnSelected.Visible = false;
-                                    closeBtnSelected.Visible = true;
-                                    pausePickerViewfra.Height = Application.GetRealHeight(600);
-                                    //濡傛灉绌鸿皟鐘舵�佹槸鍏筹紱鐩存帴璺冲嚭for寰潖锛�
-                                    break;
-
-                                }
-                                else
-                                {
-                                    openBtnSelected.Visible = true;
-                                    closeBtnSelected.Visible = false;
-                                    pausePickerViewfra.Height = Application.GetRealHeight(0);
-                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 0);
-                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 1);
-                                    mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 2);
-                                }
-
-
-                                if (value["TaskType"] == "5")
-                                {
-                                    if (value["Data1"] == "3")
-                                    {//3---璁剧疆宸ヤ綔妯″紡(1:鑷姩;3:鍒跺喎;4:鍒剁儹;7:閫侀;8:闄ゆ箍)
-                                        dictionary(modedictionary, "Data2", value["Data2"]);
-                                        string modetext = "";
-                                        switch (value["Data2"])
-                                        {
-                                            case "3":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logiccool);
-                                                    //indexmode = 0;
-                                                }
-                                                break;
-                                            case "4":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logicheat);
-                                                    //  indexmode = 1;
-                                                }
-                                                break;
-                                            case "1":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logicauto);
-                                                    //   indexmode = 2;
-                                                }
-                                                break;
-                                            case "8":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logicdry);
-                                                    //  indexmode = 3;
-                                                }
-                                                break;
-                                            case "7":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logicfanonly);
-                                                    //indexmode = 4;
-                                                }
-                                                break;
-                                        }
-                                        indexmode = mList2.IndexOf(modetext);
-                                    }
-                                    else if (value["Data1"] == "6")
-                                    {//6---璁剧疆椋庢墖妯″紡(1:浣庨;2:涓;3:楂橀;)
-                                        dictionary(speeddictionary, "Data2", value["Data2"]);
-                                        string speedtext = "";
-                                        switch (value["Data2"])
-                                        {
-                                            case "1":
-                                                {
-                                                    speedtext = Language.StringByID(MyInternationalizationString.logiclow);
-                                                    //indexspeed = 0;
-                                                }
-                                                break;
-
-                                            case "2":
-                                                {
-                                                    speedtext = Language.StringByID(MyInternationalizationString.logicmedium);
-                                                    // indexspeed = 1;
-                                                }
-                                                break;
-                                            case "3":
-                                                {
-                                                    speedtext = Language.StringByID(MyInternationalizationString.logichigh);
-                                                    // indexspeed = 2;
-                                                }
-                                                break;
-
-                                        }
-                                        indexspeed = mList3.IndexOf(speedtext);
-                                    }
-                                    //4-璁剧疆鍔犵儹搴︽暟;5-璁剧疆鍒跺喎銆侀櫎婀垮害鏁�;7-璁剧疆鑷姩搴︽暟
-                                    else if (value["Data1"] == "4" || value["Data1"] == "5" || value["Data1"] == "7")
-                                    {
-                                        var s = int.Parse(value["Data2"]) / 100;
-                                        indextemperature = mList1.IndexOf(s.ToString() + " " + "鈩�");
-                                        dictionary(temperaturedictionary, "Data1", value["Data1"]);
-                                        dictionary(temperaturedictionary, "Data2", value["Data2"]);
-                                    }
-
-                                }
-                            }
-                        }
-                        ///鏇存柊鏈�鏂扮┖璋冪姸鎬侊紱
-                        mUIPickerView.setCurrentItems(indextemperature, indexmode, indexspeed);
-                     
-                        ///纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 0);
-                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 1);
-                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnSelectedColor, 2);
-                            mUIPickerView.setCurrentItems(indextemperature, indexmode, indexspeed);
-                            pausePickerViewfra.Height = Application.GetRealHeight(0);
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            //娓呴櫎涔嬪墠鏁版嵁锛�
-                            taskListInfo.Clear();
-                            //鍔犺浇鏂版暟鎹紱
-                            dictionary(temperaturedictionary, "TaskType", "5");
-                            dictionary(modedictionary, "TaskType", "5");
-                            dictionary(modedictionary, "Data1", "3");
-                            dictionary(speeddictionary, "TaskType", "5");
-                            dictionary(speeddictionary, "Data1", "6");
-                            taskListInfo.Add(temperaturedictionary);
-                            taskListInfo.Add(modedictionary);
-                            taskListInfo.Add(speeddictionary);
-                          
-                            var temperature = mList1[indextemperature].Split(' ')[0];
-                            var modestring = mList2[indexmode].Split(' ')[0];
-                            var speedstring = mList3[indexspeed].Split(' ')[0];
-
-                            ModeState(modestring, temperaturedictionary, modedictionary);
-                            var a = int.Parse(temperature) * 100;
-                            dictionary(temperaturedictionary, "Data2", a.ToString());
-                            SpeedState(speedstring, speeddictionary);
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-
-                        ///鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 0);
-                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 1);
-                            mUIPickerView.setTextColorCenter(ZigbeeColor.Current.LogicBtnCancelColor, 2);
-                            mUIPickerView.setCurrentItems(indextemperature, indexmode, indexspeed);
-                            //娓呴櫎涔嬪墠鏁版嵁锛�
-                            taskListInfo.Clear();
-                            dictionary(modedictionary, "TaskType", "5");
-                            dictionary(modedictionary, "Data1", "3");
-                            dictionary(modedictionary, "Data2", "0");
-                            //鍔犺浇鏂版暟鎹紱
-                            taskListInfo.Add(modedictionary);
-                            pausePickerViewfra.Height = Application.GetRealHeight(600);
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-                    }
-                    break;
-                   
-                    
-            }
-
-            Btncomplete.MouseUpEventHandler += (sender, e) =>
-            {
-
-                if (SelectedDeviceStatusaction == "yes")
-                {
-                    LogicIfon.AddDeviceactions(common, actionsInfo);
-                }
-                else
-                {
-                    if (!edit)
-                    {
-                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
-                               Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
-                              Language.StringByID(MyInternationalizationString.confrim));
-                        alert.Show();
-                        return;
-                    }
-
-                }
-                flMain.RemoveFromParent();
-                var logicCommunalPage = new LogicCommunalPage();
-                UserView.HomePage.Instance.AddChidren(logicCommunalPage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                logicCommunalPage.Show(() => { });
-
-            };
-
-        }
-
-        public  static void dictionary(Dictionary<string, string> deviceactionsInfo, string Key, string Value)
-        {
-            if (deviceactionsInfo.ContainsKey(Key))
-            {
-                deviceactionsInfo.Remove(Key);
-            }
-            deviceactionsInfo.Add(Key, Value);
-        }
-        /// <summary>
-        /// 绌鸿皟妯″紡鐨勭姸鎬�
-        /// </summary>
-        /// <param name="modestring"></param>
-        /// <param name="temperaturedictionary"></param>
-        /// <param name="modedictionary"></param>
-        public static void ModeState(string modestring,Dictionary<string,string> temperaturedictionary, Dictionary<string, string> modedictionary)
-        {
-
-            if (modestring == Language.StringByID(MyInternationalizationString.logiccool))
-            {
-                dictionary(modedictionary, "Data2", "3");
-                dictionary(temperaturedictionary, "Data1", "5");
-            }
-            else if (modestring == Language.StringByID(MyInternationalizationString.logicheat))
-            {
-
-                dictionary(modedictionary, "Data2", "4");
-                dictionary(temperaturedictionary, "Data1", "4");
-            }
-            else if (modestring == Language.StringByID(MyInternationalizationString.logicauto))
-            {
-
-                dictionary(modedictionary, "Data2", "1");
-                dictionary(temperaturedictionary, "Data1", "7");
-            }
-            else if (modestring == Language.StringByID(MyInternationalizationString.logicdry))
-            {
-
-                dictionary(modedictionary, "Data2", "8");
-                dictionary(temperaturedictionary, "Data1", "5");
-            }
-            else if (modestring == Language.StringByID(MyInternationalizationString.logicfanonly))
-            {
-                dictionary(temperaturedictionary, "Data1", "20");
-                dictionary(modedictionary, "Data2", "7");
-            }
-
-        }
-        /// <summary>
-        /// 椋庨�熺殑妯″紡
-        /// </summary>
-        /// <param name="speedstring"></param>
-        /// <param name="speeddictionary"></param>
-        public static void SpeedState(string speedstring, Dictionary<string, string> speeddictionary) {
-
-            if (speedstring == Language.StringByID(MyInternationalizationString.logiclow))
-            {
-
-                dictionary(speeddictionary, "Data2", "1");
-
-            }
-            else if (speedstring == Language.StringByID(MyInternationalizationString.logicmedium))
-            {
-
-                dictionary(speeddictionary, "Data2", "2");
-
-            }
-            else if (speedstring == Language.StringByID(MyInternationalizationString.logichigh))
-            {
-
-                dictionary(speeddictionary, "Data2", "3");
-            }
-
-        }
-
-    }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicListAutomation.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicListAutomation.cs
deleted file mode 100644
index 5115045..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicListAutomation.cs
+++ /dev/null
@@ -1,135 +0,0 @@
-锘縰sing System;
-using Shared;
-using Shared.Common;
-using Shared.Phone;
-using Shared.R;
-using ZigBee.Device;
-
-namespace Shared.Phone.Device.Logic
-{
-    public class LogicListAutomation : FrameLayout
-    {
-        public LogicListAutomation ()
-        {
-            Tag = "Logic";
-        }
-        Button beforeClickButton = new Button ();
-
-        public void Show ()
-        {
-            this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor;
-            this.AddChidren (new Button {
-                Height = Application.GetRealHeight (80),
-            });
-
-            var topFrameLayout = new FrameLayout {
-                Height = Application.GetRealHeight (140),
-                Y = Application.GetRealHeight (80),
-            };
-            AddChidren (topFrameLayout);
-
-            var titleName = new Button {
-                TextID = MyInternationalizationString.automation,
-                TextSize = 16,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                IsBold = true,
-            };
-            topFrameLayout.AddChidren (titleName);
-
-            var back = new Button {
-                Width = Application.GetRealWidth (110),
-                Height = Application.GetRealHeight (110),
-                X = Application.GetRealWidth (20),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "ZigeeLogic/Back.png",
-            };
-            topFrameLayout.AddChidren (back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent ();
-            };
-
-        
-            var middle = new VerticalScrolViewLayout ();
-            middle.Y = topFrameLayout.Bottom;
-            middle.Height = Application.GetRealHeight (1920 - 220 - 174);
-            middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
-            this.AddChidren (middle);
-
-
-
-            Common.Logic Logic = null;
-            foreach (var logics in Shared.Common.Logic.LogicList) {
-                var deviceRowLayout = new RowLayout {
-                    Height = Application.GetRealHeight (180),
-                };
-                middle.AddChidren (deviceRowLayout);
-
-
-                var btn = new Button {
-                    Height = Application.GetRealHeight (180),
-                    Width = LayoutParams.MatchParent,
-                    SelectedBackgroundColor = 0xfffe5e00,
-                };
-                deviceRowLayout.AddChidren (btn);
-
-
-                var btnlogic = new Button {
-                    Width = Application.GetRealWidth (600),
-                    Text = logics.LogicName,
-                    TextAlignment = TextAlignment.CenterLeft,
-                    X = Application.GetRealWidth (40),
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                };
-                deviceRowLayout.AddChidren (btnlogic);
-
-
-                var btnlogicback = new Button {
-                    Width = Application.GetRealWidth (110),
-                    Height = Application.GetRealHeight (110),
-                    UnSelectedImagePath = "ZigeeLogic/next.png",
-                    X = Application.GetRealWidth (1080-140),
-                    Gravity=Gravity.CenterVertical,
-                };
-                deviceRowLayout.AddChidren (btnlogicback);
-
-                EventHandler<MouseEventArgs> logicclick = (sender, e) =>
-                {
-                    Logic = logics;
-                    beforeClickButton.IsSelected = false;
-                    beforeClickButton = btn;
-                    btn.IsSelected = true;
-                };
-                btnlogic.MouseUpEventHandler += logicclick;
-                deviceRowLayout.MouseUpEventHandler += logicclick;
-                btnlogicback.MouseUpEventHandler += logicclick;
-                btn.MouseUpEventHandler += logicclick;
-
-            }
-                       
-
-            var btncomplete = new Button {
-                Y = middle.Bottom,
-                Height = Application.GetRealHeight (174),
-                TextID = MyInternationalizationString.complete,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize=16,
-            };
-            AddChidren (btncomplete);
-
-            btncomplete.MouseUpEventHandler += (sedder, e) => {
-                if (Shared.Common.Logic.LogicList.Count == 0||Logic==null) {
-                    var alert = new Alert (Language.StringByID (MyInternationalizationString.Prompt),
-                    Language.StringByID (MyInternationalizationString.selectlogiccondition),
-                                           Language.StringByID (MyInternationalizationString.complete));
-                    alert.Show ();
-                    return;
-                }
-                var selectedLogicStatus = new SelectedLogicStatus ();
-                UserView.HomePage.Instance.AddChidren (selectedLogicStatus);
-                UserView.HomePage.Instance.PageIndex += 1;
-                selectedLogicStatus.Show (Logic);
-            };
-
-        }
-    }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicListPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicListPage.cs
deleted file mode 100644
index cdc5a3d..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicListPage.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Newtonsoft.Json.Linq;
-using Shared;
-using Shared.Common;
-using Shared.Phone;
-using Shared.R;
-using ZigBee.Device;
-
-
-namespace Shared.Phone.Device.Logic
-{
-    public class LogicListPage : FrameLayout
-    {
-        public LogicListPage ()
-        {
-            Tag = "Logic";
-        }
-        Button beforeClickButton = new Button ();
-        Common.Logic logicIfon = null;
-        public void Show ()
-        {
-
-            this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor;
-            this.AddChidren (new Button {
-                Height = Application.GetRealHeight (80),
-            });
-
-            var topFrameLayout = new FrameLayout {
-                Height = Application.GetRealHeight (180),
-                Y = Application.GetRealHeight (80),
-            };
-            AddChidren (topFrameLayout);
-
-            var titleName = new Button {
-                TextID = MyInternationalizationString.automation,
-                TextSize = 16,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                IsBold = true,
-            };
-            topFrameLayout.AddChidren (titleName);
-
-            var back = new Button {
-                Width = Application.GetRealWidth (110),
-                Height = Application.GetRealHeight (110),
-                X = Application.GetRealWidth (20),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "ZigeeLogic/Back.png",
-            };
-            topFrameLayout.AddChidren (back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent ();
-            };
-
-            var searchdevice = new Button {
-                Width = Application.GetMinRealAverage (100),
-                Height = Application.GetMinRealAverage (100),
-                X = Application.GetRealWidth (1080-140),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "ZigeeLogic/seekdevice.png",
-            };
-            topFrameLayout.AddChidren (searchdevice);
-           
-            var middle = new VerticalScrolViewLayout ();
-            middle.Y = topFrameLayout.Bottom;
-            middle.Height = Application.GetRealHeight (1920 - 220 - 174);
-            middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
-            this.AddChidren (middle);
-
-            var btncomplete = new Button {
-                Y = middle.Bottom,
-                Height = Application.GetRealHeight (174),
-                TextID = MyInternationalizationString.complete,
-                TextSize=16,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-            };
-            AddChidren (btncomplete);
-
-            ///鍔犺浇閫昏緫鐣岄潰鐨勬柟娉�
-            refreshlogicView(middle);
-
-            ///閫昏緫鍒锋柊鍥炬爣鐨勭偣鍑讳簨浠�
-            searchdevice.MouseUpEventHandler += (sender, e) => {
-                middle.RemoveAll();
-                logicIfon = null;
-                ///璇诲彇閫昏緫
-                //refreshlogiclist(() => {
-                //    ///鍔犺浇閫昏緫鐣岄潰鐨勬柟娉�
-                //    refreshlogicView(middle);
-                //});
-
-            };
-
-            ///淇濆瓨鎺т欢鐨勭偣鍑讳簨浠�
-            btncomplete.MouseUpEventHandler += (sedder, e) => {
-                if (Shared.Common.Logic.LogicList.Count == 0||logicIfon==null) {
-                    var alert = new Alert (Language.StringByID (MyInternationalizationString.Prompt),
-                    Language.StringByID (MyInternationalizationString.selectlogic),
-                                           Language.StringByID (MyInternationalizationString.complete));
-                    alert.Show ();
-                    return;
-                }
-
-                var selectedLogicState = new SelectedLogicState ();
-                UserView.HomePage.Instance.AddChidren (selectedLogicState);
-                UserView.HomePage.Instance.PageIndex += 1;
-                selectedLogicState.Show (logicIfon);
-            };
-
-        }
-      
-        /// <summary>
-        /// 鍔犺浇閫昏緫鐣岄潰鐨勬柟娉�
-        /// </summary>
-        /// <param name="middle">Middle.</param>
-        /// <param name="logicIfon">Logic ifon.</param>
-        void refreshlogicView (VerticalScrolViewLayout middle ) 
-        {
-            foreach (var logic in Shared.Common.Logic.LogicList) {
-                var deviceRowLayout = new RowLayout {
-                    Height = Application.GetRealHeight (180),
-                };
-                middle.AddChidren (deviceRowLayout);
-
-                var btn = new Button {
-                    Height = Application.GetRealHeight (180),
-                    Width = LayoutParams.MatchParent,
-                    SelectedBackgroundColor = 0xfffe5e00,
-                };
-                deviceRowLayout.AddChidren (btn);
-
-                var btnlogic = new Button {
-                    Width = Application.GetRealWidth (600),
-                    Text = logic.LogicName,
-                    TextAlignment = TextAlignment.CenterLeft,
-                    X = Application.GetRealWidth (40),
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                };
-                deviceRowLayout.AddChidren (btnlogic);
-
-                var btnlogicback = new Button {
-                    Width = Application.GetRealWidth (110),
-                    Height = Application.GetRealHeight (110),
-                    UnSelectedImagePath = "ZigeeLogic/next.png",
-                    SelectedImagePath = "ZigeeLogic/NextSelecte.png",
-                    X = Application.GetRealWidth (1080-140),
-                    Gravity=Gravity.CenterVertical,
-                };
-                deviceRowLayout.AddChidren (btnlogicback);
-
-                EventHandler<MouseEventArgs> logicclick = (sender, e) => {
-                    logicIfon = logic;
-                    beforeClickButton.IsSelected = false;
-                    beforeClickButton = btn;
-                    btn.IsSelected = true;
-                };
-                btnlogic.MouseUpEventHandler += logicclick;
-                deviceRowLayout.MouseUpEventHandler += logicclick;
-                btnlogicback.MouseUpEventHandler += logicclick;
-                btn.MouseUpEventHandler += logicclick;
-            }
-
-        }
-    }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/AddDeviceView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/AddDeviceView.cs
new file mode 100644
index 0000000..e8e3e20
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/AddDeviceView.cs
@@ -0,0 +1,49 @@
+锘縰sing System;
+using Shared.Common;
+
+namespace Shared.Phone.Device.Logic.LogicView
+{
+    public class AddDeviceView
+    {
+        public FrameLayout addframeLayout = new FrameLayout
+        {
+            Height = Application.GetRealHeight(160 + 30 + 50),
+            BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+        };
+        public Button addIconBtn = new Button
+        {
+            Height = Application.GetRealHeight(130 + 50),
+            Width = Application.GetRealWidth(908),
+            Y = Application.GetRealHeight(30),
+            X = Application.GetRealWidth(86),
+            UnSelectedImagePath = "ZigeeLogic/logicaddcolor.png",
+        };
+        public Button titleBtn = new Button
+        {
+            Height = Application.GetRealHeight(58),
+            Width = Application.GetRealWidth(400),
+            Y = Application.GetRealHeight(45 + 30),
+            TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+            //TextID = MyInternationalizationString.addfunction,
+            X = Application.GetRealWidth(340),
+            TextSize = 14,
+        };
+        /// <summary>
+        /// 鐐瑰嚮鐑敭
+        /// </summary>
+        public Button clickBtn = new Button
+        {
+            Width = Application.GetRealWidth(1080 - 2 * 86),
+            Height = Application.GetRealHeight(130 + 50),
+            X = Application.GetRealWidth(86),
+        };
+        public FrameLayout AddFl()
+        {
+            addframeLayout.AddChidren(addIconBtn);
+            addframeLayout.AddChidren(titleBtn);
+            addframeLayout.AddChidren(clickBtn);
+            return addframeLayout;
+        }
+
+    }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/Addview.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/Addview.cs
new file mode 100644
index 0000000..b283963
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/Addview.cs
@@ -0,0 +1,77 @@
+锘縰sing System;
+using Shared.Common;
+using Shared.R;
+namespace Shared.Phone.Device.Logic.LogicView
+{
+    public class Addview
+    {
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Height = Application.GetRealHeight(160),
+            BackgroundColor=ZigbeeColor.Current.LogicBlankBackgroundColor,
+        };
+        public Button lineBtn = new Button
+        {
+            Y = Application.GetRealHeight(155),
+            Width = Application.GetRealWidth(1080-58-58),
+            Height = Application.GetRealHeight(5),
+            X = Application.GetRealWidth(58),
+            BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+        };
+        public Button titleBtn = new Button
+        {
+            Y = Application.GetRealHeight(30 + 35),
+            X = Application.GetRealWidth(58),
+            Text = Language.StringByID(MyInternationalizationString.ifcondition),
+            TextAlignment = TextAlignment.CenterLeft,
+            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+            Width = Application.GetRealWidth(300),
+            Height = Application.GetRealHeight(60),
+            TextSize = 15,
+            Gravity = Gravity.CenterVertical,
+        };
+
+        public Button iconBtn = new Button
+        {
+
+            Width = Application.GetRealWidth(58),
+            Height = Application.GetRealHeight(58),
+            UnSelectedImagePath = "ZigeeLogic/add.png",
+            X = Application.GetRealWidth(1080 - 58-58),
+            Y = Application.GetRealHeight(30 + 36),
+            Visible=false,
+        };
+
+        public Button switchBtn = new Button
+        {
+            Width = Application.GetMinRealAverage(104),
+            Height = Application.GetMinRealAverage(63),
+            UnSelectedImagePath = "ZigeeLogic/logicclose.png",
+            SelectedImagePath = "ZigeeLogic/logicopen.png",
+            X = Application.GetRealWidth(1080 - 58 - 104),
+            Y = Application.GetRealHeight(30 + 33),
+            Visible = false,
+        };
+        /// <summary>
+        /// 鍔犲ぇ鐐瑰嚮鐑敭
+        /// </summary>
+        public Button clickBtn = new Button
+        {
+
+            Width = Application.GetRealWidth(58 +58+40),
+            Height = Application.GetRealHeight(160),
+            X = Application.GetRealWidth(1080 - 58 - 58),
+        };
+
+        public FrameLayout AddDeviceView()
+        {
+            frameLayout.AddChidren(lineBtn);
+            frameLayout.AddChidren(titleBtn);
+            frameLayout.AddChidren(iconBtn);
+            frameLayout.AddChidren(switchBtn);
+            frameLayout.AddChidren(clickBtn);
+            return frameLayout;
+        }
+
+    }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/CompleteView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/CompleteView.cs
new file mode 100644
index 0000000..4a26274
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/CompleteView.cs
@@ -0,0 +1,70 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared.Common;
+using Shared.R;
+using ZigBee.Device;
+namespace Shared.Phone.Device.Logic
+{
+    public class CompleteView
+    {
+        public FrameLayout fraView = new FrameLayout
+        {
+            Width = Application.GetRealWidth(1080),
+            Height = Application.GetRealHeight(140 + 320 + 70),
+            Y = Application.GetRealHeight(1920 - 530),
+            BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
+            // Radius = (uint)Application.GetRealHeight(60),
+        };
+        #region  -------鍙栨秷   瀹屾垚
+        public RowLayout titleRow = new RowLayout
+        {
+            Height = Application.GetRealHeight(140),
+            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+        };
+        public Button Btncancel = new Button
+        {
+            TextID = MyInternationalizationString.cancel,
+            TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+            Height = Application.GetRealHeight(140),
+            Width = Application.GetRealWidth(200),
+            X = Application.GetRealWidth(80),
+            TextAlignment = TextAlignment.CenterLeft,
+            TextSize = 14,
+        };
+        public Button Btntitle = new Button
+        {
+            //TextID = MyInternationalizationString.type,
+            TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
+            Height = Application.GetRealHeight(140),
+            Width = Application.GetRealWidth(420),
+            TextAlignment = TextAlignment.Center,
+            X = Application.GetRealWidth(280 + 50),
+            TextSize = 16,
+        };
+        public Button Btncomplete = new Button
+        {
+            TextID = MyInternationalizationString.complete,
+            TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
+            Height = Application.GetRealHeight(140),
+            Width = Application.GetRealWidth(200),
+            TextAlignment = TextAlignment.CenterRight,
+            X = Application.GetRealWidth(750+50),
+            TextSize = 14,
+        };
+        #endregion
+       
+        public FrameLayout Show(int n)
+        {
+            //n澶氬皯琛�
+            fraView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
+            fraView.Height = Application.GetRealHeight(140 + 70 + 160 * n);
+            fraView.Y = Application.GetRealHeight(1920 - 140 - 70 - 160 * n);
+            fraView.AddChidren(titleRow);
+            fraView.AddChidren(Btncancel);
+            fraView.AddChidren(Btntitle);
+            fraView.AddChidren(Btncomplete);
+            return fraView;
+        }
+
+    }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/FunView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/FunView.cs
new file mode 100644
index 0000000..efced4a
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/FunView.cs
@@ -0,0 +1,70 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared.Common;
+using Shared.R;
+using ZigBee.Device;
+namespace Shared.Phone.Device.Logic
+{
+    public class FunView
+    {
+        #region  ----鍔熻兘鍧楁帶浠�----
+        public FrameLayout funFrameLayout = new FrameLayout
+        {
+            Height = Application.GetRealHeight(160),
+            BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+        };
+        public Button iconBtn = new Button
+        {
+            Width = Application.GetRealWidth(81),
+            Height = Application.GetRealHeight(81),
+            X = Application.GetRealWidth(58),
+            Y = Application.GetRealHeight(55),
+            //UnSelectedImagePath = $"ZigeeLogic/{iocn}.png",
+        };
+        public Button funnameBtn = new Button
+        {
+            //Text = Language.StringByID(MyInternationalizationString.timecondition),
+            TextAlignment = TextAlignment.CenterLeft,
+            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+            TextSize = 15,
+            Y = Application.GetRealHeight(30),
+            X = Application.GetRealWidth(176),
+            Height = Application.GetRealHeight(130),
+            Width = Application.GetRealWidth(400),
+        };
+        public Button funnextBtn = new Button
+        {
+            Width = Application.GetRealWidth(58),
+            Height = Application.GetRealHeight(58),
+            UnSelectedImagePath = "ZigeeLogic/next.png",
+            X = Application.GetRealWidth(789 + 176),
+            Y = Application.GetRealHeight(30 + 36),
+        };
+        public Button lineBtn = new Button
+        {
+            Y = Application.GetRealHeight(155),
+            Width = Application.GetRealWidth(850),
+            Height = Application.GetRealHeight(5),
+            X = Application.GetRealWidth(176),
+            BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+        };
+        public Button clickviewBtn = new Button
+        {
+            Height = Application.GetRealHeight(160),
+        };
+
+        public FrameLayout FunFrameView()
+        {
+           
+            funFrameLayout.AddChidren(iconBtn);
+            funFrameLayout.AddChidren(funnameBtn);
+            funFrameLayout.AddChidren(funnextBtn);
+            funFrameLayout.AddChidren(lineBtn);
+            funFrameLayout.AddChidren(clickviewBtn);
+            return funFrameLayout;
+        }
+
+        
+        #endregion
+    }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/IfString.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/IfString.cs
new file mode 100644
index 0000000..13b3d18
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/IfString.cs
@@ -0,0 +1,52 @@
+锘縰sing System;
+namespace Shared.Phone.Device.Logic.LogicView
+{
+    /// <summary>
+    /// 鑷畾涔夊瓧绗︿覆瀵硅薄
+    /// </summary>
+    public class IfString
+    {
+        /// <summary>
+        /// -鑷姩鍖�-鐨勫垽鏂瓧绗︿覆
+        /// </summary>
+        public static string _Logic = "Logic";
+        /// <summary>
+        ///- 闂ㄩ攣-鑱斿姩浜嬩欢鐨勫垽鏂瓧绗︿覆
+        /// </summary>
+        public static string _LockLogic = "LockLogic";
+        /// <summary>
+        /// 鑷姩鍖栫殑-鏉′欢-鍒ゆ柇瀛楃涓�
+        /// </summary>
+        public static string Condition_Logic = "condition_logic";
+        /// <summary>
+        /// 鑷姩鍖栫殑-鐩爣-鍒ゆ柇瀛楃涓�
+        /// </summary>
+        public static string Action_Logic = "action_logic";
+        /// <summary>
+        /// 鑷姩鍖栫殑-鐩爣鍦烘櫙-鍒ゆ柇瀛楃涓�
+        /// </summary>
+        public static string Action_LogicScene = "action_logicscene";
+        /// <summary>
+        /// 鑷姩鍖栨帹鑽愭ā鏉跨殑-鏉′欢-鍒ゆ柇瀛楃涓�
+        /// </summary>
+        public static string Condition_Mould = "condition_mould";
+        /// <summary>
+        /// 鑷姩鍖栨帹鑽愭ā鏉跨殑-鐩爣-鍒ゆ柇瀛楃涓�
+        /// </summary>
+        public static string Action_Mould = "action_mould";
+        /// <summary>
+        /// 闂ㄩ攣鑱斿姩浜嬩欢鐨�-鐩爣-鍒ゆ柇瀛楃涓�
+        /// </summary>
+        public static string Action_LockAction = "action_lockaction";
+        /// <summary>
+        /// 闂ㄩ攣鑱斿姩浜嬩欢鐨�-鐩爣鍦烘櫙-鍒ゆ柇瀛楃涓�
+        /// </summary>
+        public static string Action_LockScene = "action_lockscene";
+        /// <summary>
+        /// 鏍囪閫昏緫鎺ㄩ�佹枃鏈紑鍏崇姸鎬�;
+        /// 榛樿涓篺alse锛�
+        /// </summary>
+        public static bool Tag = false;
+    }
+
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SaveView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SaveView.cs
new file mode 100644
index 0000000..3eb3649
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SaveView.cs
@@ -0,0 +1,36 @@
+锘縰sing System;
+using Shared.Common;
+using Shared.R;
+
+namespace Shared.Phone.Device.Logic.LogicView
+{
+    public class SaveView
+    {
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Height = Application.GetRealHeight(260),
+            BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
+        };
+        public Button saveBtn = new Button
+        {
+            X = Application.GetRealWidth(85),
+            Height = Application.GetRealHeight(130),
+            Width = Application.GetRealWidth(910),
+            Radius = (uint)Application.GetRealHeight(60),
+            BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
+            TextID = MyInternationalizationString.Save,
+            TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
+            TextSize = 16,
+        };
+        public Button clickviewBtn = new Button
+        {
+            Height = Application.GetRealHeight(260),
+        };
+        public FrameLayout Show()
+        {
+            frameLayout.AddChidren(saveBtn);
+            frameLayout.AddChidren(clickviewBtn);
+            return frameLayout;
+        }
+    }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SelectedButton.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedButton.cs
similarity index 100%
rename from ZigbeeApp/Shared/Phone/Device/Logic/SelectedButton.cs
rename to ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedButton.cs
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedDeviceView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedDeviceView.cs
new file mode 100644
index 0000000..faf0fb9
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/SelectedDeviceView.cs
@@ -0,0 +1,121 @@
+锘縰sing System;
+using Shared.Common;
+
+namespace Shared.Phone.Device.Logic
+{
+    public class SelectedDeviceView
+    {
+
+        public FrameLayout selecetdFrameLayout = new FrameLayout
+        {
+            Height = Application.GetRealHeight(130),
+            BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+        };
+
+        /// <summary>
+        /// 鏄剧ず鍥炬爣
+        /// </summary>
+        public Button iconBtn = new Button
+        {
+            Width = Application.GetRealWidth(81),
+            Height = Application.GetRealHeight(81),
+            X = Application.GetRealWidth(104),
+            Y = Application.GetRealHeight(25),
+            // UnSelectedImagePath = "ZigeeLogic/time.png",
+
+        };
+        ///
+        public RowLayout stateRow = new RowLayout
+        {
+            Width = Application.GetRealWidth(800),
+            Height = Application.GetRealHeight(130),
+            X = Application.GetRealWidth(222),
+            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+        };
+        /// <summary>
+        /// 鏄剧ず鍚嶅瓧(闄よ澶囩被鍨嬪)
+        /// </summary>
+        public Button ordinaryBtn = new Button
+        {
+            Width = Application.GetRealWidth(400),
+            TextAlignment = TextAlignment.CenterLeft,
+            Gravity = Gravity.CenterVertical,
+            TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+            TextSize = 14,
+            Visible = false,
+        };
+        /// <summary>
+        /// 璁惧鐨勫悕瀛�
+        /// </summary>
+        public Button deviceNameBtn = new Button
+        {
+            Y = Application.GetRealHeight(20),
+            Height = Application.GetRealHeight(50),
+            Width = Application.GetRealWidth(400),
+            TextAlignment = TextAlignment.CenterLeft,
+            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+            TextSize = 14,
+            Visible = false,
+        };
+
+        /// <summary>
+        /// 鍖哄煙(鎴块棿)鍚嶇ОButton
+        /// </summary>
+        public Button regionNameBtn = new Button
+        {
+            Y = Application.GetRealHeight(10 + 70),
+            Width = Application.GetRealWidth(400),
+            TextAlignment = TextAlignment.CenterLeft,
+            Height = Application.GetRealHeight(50),
+            Text = "",//Language.StringByID(MyInternationalizationString.customroom),
+            TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+            Visible=false,
+        };
+        /// <summary>
+        /// 鏄剧ず璁惧鏉′欢鐘舵�佹帶浠�
+        /// </summary>
+        public Button selecetddevicestateBtn = new Button
+        {
+            Width = Application.GetRealWidth(400),
+            Height = Application.GetRealHeight(130),
+            Gravity = Gravity.CenterVertical,
+            TextAlignment = TextAlignment.CenterRight,
+            X = Application.GetRealWidth(400),
+            TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+            TextSize = 14,
+        };
+       
+
+
+        /// <summary>
+        /// 缂栬緫
+        /// </summary>
+        public Button edit = new Button
+        {
+            BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
+            Text = Language.StringByID(R.MyInternationalizationString.edit),
+            TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
+        };
+        /// <summary>
+        /// 鍒犻櫎
+        /// </summary>
+        public Button del = new Button
+        {
+            BackgroundColor = ZigbeeColor.Current.LogicDelBlackColor1,
+            Text = Language.StringByID(R.MyInternationalizationString.del),
+        };
+        public void Show(VerticalScrolViewLayout middle)
+        {
+            middle.AddChidren(selecetdFrameLayout);
+            selecetdFrameLayout.AddChidren(iconBtn);
+            selecetdFrameLayout.AddChidren(stateRow);
+            stateRow.AddRightView(edit);
+            stateRow.AddRightView(del);
+            stateRow.AddChidren(deviceNameBtn);
+            stateRow.AddChidren(regionNameBtn);
+            stateRow.AddChidren(ordinaryBtn);
+            stateRow.AddChidren(selecetddevicestateBtn);
+
+        }
+    }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TopView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TopView.cs
new file mode 100644
index 0000000..2ae0f43
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TopView.cs
@@ -0,0 +1,115 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared.Common;
+using Shared.R;
+using ZigBee.Device;
+namespace Shared.Phone.Device.Logic
+{
+    public class TopView
+    {
+        #region 鏈�涓婇潰閭e潡鎺т欢
+        /// <summary>
+        /// 鏈�涓婇潰鍧梀iew
+        /// </summary>
+        public RowLayout topRowLayout = new RowLayout
+        {
+            BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
+            Height = Application.GetRealHeight(184),
+            LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
+        };
+        /// <summary>
+        /// 鏍囬Btn
+        /// </summary>
+        public Button toptitleNameBtn = new Button
+        {
+            TextSize = 17,
+            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+            TextAlignment = TextAlignment.CenterLeft,
+            X = Application.GetRealWidth(176),
+            Width = Application.GetRealWidth(600),
+            Height = Application.GetRealHeight(69),
+            Y = Application.GetRealHeight(92),
+            IsBold = true
+        };
+       
+        /// <summary>
+        /// 鍚庨��Btn
+        /// </summary>
+        public Button backBtn = new Button
+        {
+            Width = Application.GetRealWidth(30),
+            Height = Application.GetRealHeight(51),
+            X = Application.GetRealWidth(81),
+            Y = Application.GetRealHeight(98),
+            //Gravity = Gravity.CenterVertical;
+            UnSelectedImagePath = "ZigeeLogic/back.png",
+        };
+        /// <summary>
+        /// 澧炲姞鐑敭澶у皬Btn
+        /// </summary>
+        public Button clickBtn = new Button
+        {
+            Width = Application.GetRealWidth(81 + 51),
+            Height = Application.GetRealHeight(58 + 40),
+            Y = Application.GetRealHeight(98 - 40),
+        };
+
+
+
+        /// <summary>
+        /// 鏄剧ず灞傛ゼBtn
+        /// </summary>
+        public Button foolrnameBtn = new Button
+        {
+            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+            TextAlignment = TextAlignment.CenterRight,
+            X = Application.GetRealWidth(1080 - 400 - 120),
+            Width = Application.GetRealWidth(400),
+            Height = Application.GetRealHeight(69),
+            Y = Application.GetRealHeight(92),
+            Text = Config.Instance.Home.GetCurrentFloorName,
+        };
+        /// <summary>
+        /// 涓嬫媺鍥炬爣Btn
+        /// </summary>
+        public Button dropdownBtn = new Button
+        {
+            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+            TextAlignment = TextAlignment.CenterRight,
+            X = Application.GetRealWidth(1080 - 120),
+            Width = Application.GetRealWidth(72),
+            Height = Application.GetRealHeight(72),
+            Y = Application.GetRealHeight(92),
+            UnSelectedImagePath = "ZigeeLogic/drop-down.png",
+        };
+        /// <summary>
+        /// 澧炲姞鐑敭澶у皬Btn
+        /// </summary>
+        public Button foolrclickBtn = new Button
+        {
+            Width = Application.GetRealWidth(400 + 120),
+            Height = Application.GetRealHeight(72),
+            Y = Application.GetRealHeight(92),
+            X = Application.GetRealWidth(1080 - 400 - 120),
+        };
+        /// <summary>
+        /// 鏈�涓婇潰鐨勯偅鍧楁柟娉�
+        /// </summary>
+        /// <param name="yes"></param>
+        /// <returns></returns>
+        public RowLayout TopRowView(bool yes = false)
+        {
+            topRowLayout.AddChidren(toptitleNameBtn);
+            topRowLayout.AddChidren(backBtn);
+            topRowLayout.AddChidren(clickBtn);
+            if (yes)
+            {
+                topRowLayout.AddChidren(foolrnameBtn);
+                topRowLayout.AddChidren(dropdownBtn);
+                topRowLayout.AddChidren(foolrclickBtn);
+            }
+            return topRowLayout;
+        }
+        #endregion
+    }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TypeView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TypeView.cs
new file mode 100644
index 0000000..d90b0fe
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/TypeView.cs
@@ -0,0 +1,72 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared.Common;
+using Shared.R;
+using ZigBee.Device;
+namespace Shared.Phone.Device.Logic.LogicView
+{
+    public class TypeView
+    {
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Height = Application.GetRealHeight(160),
+            BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+        };
+
+        public Button textBtn = new Button
+        {
+            X = Application.GetRealWidth(58),
+            Y = Application.GetRealHeight(30),
+            Text = Language.StringByID(MyInternationalizationString.type),
+            TextAlignment = TextAlignment.CenterLeft,
+            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+            Width = Application.GetRealWidth(265),
+            Height = Application.GetRealHeight(130),
+            TextSize = 14,
+
+        };
+
+        public Button titleBtn = new Button
+        {
+            Y = Application.GetRealHeight(30),
+            X = Application.GetRealWidth(265 + 58),
+            Height = Application.GetRealHeight(130),
+            Width = Application.GetRealWidth(630),
+            TextAlignment = TextAlignment.CenterRight,
+            TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+            TextSize = 14,
+        };
+
+        public Button backBtn = new Button
+        {
+            X = Application.GetRealWidth(265 + 58 + 630) + Application.GetRealWidth(12),
+            Y = Application.GetRealHeight(30 + 36),
+            Width = Application.GetRealWidth(58),
+            Height = Application.GetRealHeight(58),
+            UnSelectedImagePath = "ZigeeLogic/next.png",
+        };
+
+        public Button lineBtn = new Button
+        {
+            Y = Application.GetRealHeight(155),
+            Width = Application.GetRealWidth(965),
+            Height = Application.GetRealHeight(5),
+            X = Application.GetRealWidth(58),
+            BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+        };
+        public Button clickviewBtn = new Button
+        {
+            Height = Application.GetRealHeight(160),
+        };
+        public FrameLayout Show()
+        {
+            frameLayout.AddChidren(textBtn);
+            frameLayout.AddChidren(titleBtn);
+            frameLayout.AddChidren(backBtn);
+            frameLayout.AddChidren(lineBtn);
+            frameLayout.AddChidren(clickviewBtn);
+            return frameLayout;
+
+        }
+    }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/mFunView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/mFunView.cs
new file mode 100644
index 0000000..2994079
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicView/mFunView.cs
@@ -0,0 +1,60 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Shared.Common;
+using Shared.R;
+using ZigBee.Device;
+
+namespace Shared.Phone.Device.Logic
+{
+    public class mFunView
+    {
+
+        public FrameLayout frameLayout = new FrameLayout
+        {
+            Height = Application.GetRealHeight(160),
+        };
+
+        public Button titleBtn = new Button
+        {
+            X = Application.GetRealWidth(80),
+            Y = Application.GetRealHeight(30),
+            Height = Application.GetRealHeight(130),
+            Width = Application.GetRealWidth(600),
+            //TextID = MyInternationalizationString.logicathomegarrison,
+            TextAlignment = TextAlignment.CenterLeft,
+            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
+            TextSize = 14,
+        };
+
+        public Button selectedIconBtn = new Button
+        {
+            Y = Application.GetRealHeight(65),
+            X = Application.GetRealWidth(860 + 80),
+            Width = Application.GetMinRealAverage(60),
+            Height = Application.GetMinRealAverage(60),
+            UnSelectedImagePath = "ZigeeLogic/selected.png",
+            Visible = false,
+        };
+        public Button lineBtn = new Button
+        {
+            Y = Application.GetRealHeight(155),
+            Width = Application.GetRealWidth(920),
+            Height = Application.GetRealHeight(5),
+            X = Application.GetRealWidth(80),
+            BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+        };
+        public Button clickviewBtn = new Button
+        {
+            Height = Application.GetRealHeight(160),
+        };
+        public FrameLayout Show()
+        {
+            frameLayout.AddChidren(titleBtn);
+            frameLayout.AddChidren(selectedIconBtn);
+            frameLayout.AddChidren(lineBtn);
+            frameLayout.AddChidren(clickviewBtn);
+            return frameLayout;
+        }
+
+    }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
index 58eea86..a4a3a77 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
@@ -206,7 +206,7 @@
             }
 
 
-        }
+        }          
         /// <summary>
         /// 褰撳墠鎴愬憳淇℃伅鐨勬柟娉�
         /// </summary>
@@ -302,7 +302,7 @@
                 lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * 9) - 20 - 50);
                 lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * 9) + 20 + 50);
             }
-
+         
             for (int i = 0; i < user.UserIdMode.Count; i++)
             {
                 var userifon = user.UserIdMode[i];
@@ -332,30 +332,6 @@
                     TextSize = 14,
                 };
                 doorlockRow.AddChidren(doorlockBtn);
-                if (string.IsNullOrEmpty(doorlockBtn.Text))
-                {
-                    string strname = "";
-                    switch (userifon.OpenMode)
-                    {
-                        case 0:
-                            {
-                                strname = Language.StringByID(MyInternationalizationString.lockpassword);
-                            }
-                            break;
-                        case 3:
-                            {
-                                strname = Language.StringByID(MyInternationalizationString.ic);
-                            }
-                            break;
-                        case 15:
-                            {
-                                strname = Language.StringByID(MyInternationalizationString.fingerprint);
-                            }
-                            break;
-                    }
-                    doorlockBtn.Text = strname + "ID" + userifon.UserId;
-                }
-
 
                 var doorlockSelected = new Button
                 {
@@ -388,6 +364,30 @@
                 doorlockSelected.MouseUpEventHandler += doorlockclick;
                 doorlockfra.MouseUpEventHandler += doorlockclick;
 
+                if (string.IsNullOrEmpty(doorlockBtn.Text))
+                {
+                    string strname = "";
+                    switch (userifon.OpenMode)
+                    {
+                        case 0:
+                            {
+                                strname = Language.StringByID(MyInternationalizationString.lockpassword);
+                            }
+                            break;
+                        case 3:
+                            {
+                                strname = Language.StringByID(MyInternationalizationString.ic);
+                            }
+                            break;
+                        case 15:
+                            {
+                                strname = Language.StringByID(MyInternationalizationString.fingerprint);
+                            }
+                            break;
+                    }
+                    doorlockBtn.Text = userifon.UserId + strname;
+                }
+
                 if (edit && editdeviceConditionsInfo != null)
                 {
 
@@ -415,8 +415,7 @@
                 deviceConditionsInfo.Add("Range", "0");
                 deviceConditionsInfo.Add("AttriButeId", openMode);
                 deviceConditionsInfo.Add("AttriButeData2", userId);
-                userdictionary.Add("Account", Config.Instance.Guid);
-                userdictionary.Add("AccountName", accountname);//鐢ㄦ潵鏄剧ず鍚嶇О
+                userdictionary.Add("Account", accountname);
                 userdictionary.Add("Type", "1");
                 userdictionary.Add("UserId", userId);
                 if (edit)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
new file mode 100644
index 0000000..7aecfbb
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
@@ -0,0 +1,773 @@
+锘縰sing System;
+using System.Collections.Generic;
+using Newtonsoft.Json.Linq;
+using ZigBee.Device;
+using ZigBee.Common;
+using Shared.Common;
+using System.Collections.Specialized;
+using System.Net;
+using System.IO;
+using Shared.R;
+
+namespace Shared.Phone.Device.Logic
+{
+    public class Method
+    {
+
+        // <summary>
+        /// 閫氳繃璁惧鎵惧埌鍖哄煙(鎴块棿)鍚嶇О
+        /// </summary>
+        /// <param name="button">Btnregionname.</param>
+        /// <param name="device">Device.</param>
+        public static void RoomNmae(Button button, CommonDevice device)
+        {
+            var room = new Common.Room();
+            button.Text = room.GetRoomNameByDevice(device);
+        }
+        /// <summary>
+        /// 杩斿洖妤煎眰鎵�鏈夌殑鎴块棿鐨勫垪琛�
+        /// </summary>
+        /// <param name="type">鍒ゆ柇瀛楃涓�</param>
+        /// <param name="floorId">妤煎眰ID</param>
+        /// <returns></returns>
+        public static List<Common.Room> GetRoomList(string type, string floorId = null)
+        {
+            var list = new List<Common.Room>();
+            for (int i = 0; i < Common.Room.Lists.Count; i++)
+            {
+                if (type == "action_logicscene" || type == "action_lockscene")
+                {
+                    if (Common.Room.Lists[i].SceneUIList.Count == 0)
+                    {   ///杩囨护鎺夋病鏈夊満鏅殑鎴块棿
+                        continue;
+                    }
+                }
+                else
+                {
+                    ///鍖哄垎鍑鸿緭鍏ユ潯浠跺拰杈撳嚭鐩爣璁惧
+                    var listdevicetype = GetDevice(type);
+                    var listdevice = GetDeviceUIList(Common.Room.Lists[i], listdevicetype);
+                    if (listdevice.Count == 0)
+                    {
+                        ///杩囨护鎺夋病鏈夎澶囩殑鎴块棿
+                        continue;
+                    }
+                }
+                list.Add(Common.Room.Lists[i]);
+            }
+            if (string.IsNullOrEmpty(floorId))
+            {
+                //娌℃湁妤煎眰鐩存帴杩斿洖鎵�鏈夌殑鎴块棿;
+                return list;
+            }
+            //鏌愭ゼ灞傛墍鏈夌殑鎴块棿;
+            return list.FindAll((obj) => obj.FloorId == floorId);
+        }
+        /// <summary>
+        /// 鑾峰彇鎴块棿鐨勮澶囧垪琛�
+        /// </summary>
+        /// <param name="room">褰撳墠鎴块棿</param>
+        /// <param name="deviceTypelist">璁惧绫诲瀷</param>
+        /// <returns></returns>
+        public static List<DeviceUI> GetDeviceUIList(Common.Room room, List<DeviceType> deviceTypelist)
+        {
+            var deviceUIlist = new List<DeviceUI>();
+            foreach (var device in room.DeviceUIList)
+            {
+                if (device.CommonDevice == null)
+                {
+                    continue;
+                }
+                if (!deviceTypelist.Contains(device.CommonDevice.Type))
+                {
+                    //杩囨护鎺変笉鏀寔鐨勮澶�
+                    continue;
+                }
+                deviceUIlist.Add(device);
+            }
+            return deviceUIlist;
+        }
+        /// <summary>
+        /// 鎺掑垪鎵�鏈夎澶囩被鍨嬬殑鍒楄〃
+        /// </summary>
+        /// <param name="type">鍒ゆ柇瀛楃涓�</param>
+        /// <param name="devicelist">璁惧鍒楄〃</param>
+        /// <returns></returns>
+        public static List<string> GetDeviceTypeList(string type, List<DeviceUI> devicelist)
+        {
+            List<string> devicetypelist = new List<string>();
+            devicetypelist.Clear();
+            var lightjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.ColorDimmableLight || device.CommonDevice.Type == DeviceType.OnOffOutput);
+            if (lightjosn != null)
+            {
+                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Lights));
+            }
+            var iASZonejosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.IASZone || device.CommonDevice.Type == DeviceType.TemperatureSensor);
+            if (iASZonejosn != null)
+            {
+                devicetypelist.Add(Language.StringByID(MyInternationalizationString.sensor));
+            }
+            var onOffSwitchjson = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.OnOffSwitch);
+            if (onOffSwitchjson != null)
+            {
+                devicetypelist.Add(Language.StringByID(MyInternationalizationString.OnOffSwitch));
+            }
+            var doorLock = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.DoorLock);
+            if (doorLock != null)
+            {
+                devicetypelist.Add(Language.StringByID(MyInternationalizationString.doorLock));
+            }
+            var curtainjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.WindowCoveringDevice);
+            if (curtainjosn != null)
+            {
+                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains));
+            }
+            var ac = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.Thermostat);
+            if (ac != null)
+            {
+                devicetypelist.Add(Language.StringByID(MyInternationalizationString.AC));
+            }
+            var airSwitch = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.AirSwitch);
+            if (airSwitch != null)
+            {
+                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Airswitch));
+            }
+
+            return devicetypelist;
+
+        }
+        /// <summary>
+        /// 鏌愪釜璁惧绫诲瀷鐨勫垪琛�
+        /// </summary>
+        /// <param name="devicetype">鍒ゆ柇瀛楃涓�</param>
+        /// <returns></returns>
+        public static List<DeviceType> GetDeviceType(string devicetype)
+        {
+            List<DeviceType> DeviceTypeList = new List<DeviceType>();
+            DeviceTypeList.Clear();
+            if (devicetype == Language.StringByID(MyInternationalizationString.Lights))
+            {
+                DeviceTypeList.Add(DeviceType.OnOffOutput);//0x0101鍗佽繘鍒�257
+                DeviceTypeList.Add(DeviceType.DimmableLight);
+            }
+            else if (devicetype == Language.StringByID(MyInternationalizationString.Curtains))
+            {
+                DeviceTypeList.Add(DeviceType.WindowCoveringDevice);
+            }
+            else if (devicetype == Language.StringByID(MyInternationalizationString.OnOffSwitch))
+            {
+                DeviceTypeList.Add(DeviceType.OnOffSwitch);
+            }
+            else if (devicetype == Language.StringByID(MyInternationalizationString.sensor))
+            {
+                DeviceTypeList.Add(DeviceType.IASZone);
+                DeviceTypeList.Add(DeviceType.TemperatureSensor);
+            }
+            else if (devicetype == Language.StringByID(MyInternationalizationString.doorLock))
+            {
+                DeviceTypeList.Add(DeviceType.DoorLock);
+            }
+            else if (devicetype == Language.StringByID(MyInternationalizationString.Curtains))
+            {
+                DeviceTypeList.Add(DeviceType.WindowCoveringDevice);
+            }
+            else if (devicetype == Language.StringByID(MyInternationalizationString.AC))
+            {
+                DeviceTypeList.Add(DeviceType.Thermostat);
+            }
+            else if (devicetype == Language.StringByID(MyInternationalizationString.Airswitch))
+            {
+                DeviceTypeList.Add(DeviceType.AirSwitch);
+            }
+            return DeviceTypeList;
+        }
+        /// <summary>
+        /// 鏄剧ず鏌愪釜绫诲瀷璁惧鐨勫浘鏍�
+        /// </summary>
+        /// <param name="devicetype">鍒ゆ柇瀛楃涓�</param>
+        /// <returns></returns>
+        public static string GetDeviceTypeIcon(string devicetype)
+        {
+            string patm = "";
+            if (devicetype == Language.StringByID(MyInternationalizationString.OnOffSwitch))
+            {
+                patm = "ZigeeLogic/selectedpanel.png";
+            }
+            else if (devicetype == Language.StringByID(MyInternationalizationString.sensor))
+            {
+                patm = "ZigeeLogic/selectedsenor.png";
+            }
+            else if (devicetype == Language.StringByID(MyInternationalizationString.doorLock))
+            {
+                patm = "ZigeeLogic/selecteddoorlock.png";
+            }
+            else if (devicetype == Language.StringByID(MyInternationalizationString.Lights))
+            {
+                patm = "ZigeeLogic/selectedlight.png";
+            }
+            else if (devicetype == Language.StringByID(MyInternationalizationString.Curtains))
+            {
+                patm = "ZigeeLogic/selectedcurtain.png";
+            }
+            else if (devicetype == Language.StringByID(MyInternationalizationString.AC))
+            {
+                patm = "ZigeeLogic/selectedac.png";
+            }
+            else if (devicetype == Language.StringByID(MyInternationalizationString.Airswitch))
+            {
+                patm = "ZigeeLogic/selectedairswitch.png";
+            }
+            return patm;
+        }
+        /// <summary>
+        /// 鏄剧ず璁惧鐨勫浘鏍�
+        /// </summary>
+        /// <param name="device">璁惧瀵硅薄</param>
+        /// <param name="button">鏄剧ず鍥炬爣鐨勬帶浠�</param>
+        public static void GetDeviceIcon(DeviceUI device, Button button)
+        {
+            string patm = "";
+            string selectedpatm = "";
+            switch (device.CommonDevice.Type)
+            {
+                case DeviceType.OnOffOutput:
+                    {
+                        patm = "ZigeeLogic/light.png";
+                        selectedpatm = "ZigeeLogic/selectedlight.png";
+                    }
+                    break;
+                case DeviceType.IASZone:
+                    {
+                        var iASZonedevice = device.CommonDevice as IASZone;
+                        if (iASZonedevice.DeviceID != 1026)
+                        {
+                            break;
+                        }
+                        patm = $"ZigeeLogic/sensor{iASZonedevice.IasDeviceType}.png";
+                        selectedpatm = $"ZigeeLogic/selectedsensor{iASZonedevice.IasDeviceType}.png";
+                    }
+                    break;
+                case DeviceType.TemperatureSensor:
+                    {
+                        var temperatureSensor = device.CommonDevice as TemperatureSensor;
+                        if (temperatureSensor.SensorDiv == 1)
+                        {
+                            patm = $"ZigeeLogic/temperature.png";
+                            selectedpatm = $"ZigeeLogic/selectedtemperature.png";
+                        }
+                        else
+                        {
+                            patm = "ZigeeLogic/humidity.png";
+                            selectedpatm = "ZigeeLogic/selectedhumidity.png";
+                        }
+                    }
+                    break;
+                case DeviceType.OnOffSwitch:
+                    {
+                        patm = "ZigeeLogic/panel.png";
+                        selectedpatm = "ZigeeLogic/selectedpanel.png";
+                    }
+                    break;
+                case DeviceType.DoorLock:
+                    {
+                        patm = "ZigeeLogic/doorlock.png";
+                        selectedpatm = "ZigeeLogic/selecteddoorlock.png";
+                    }
+                    break;
+                case DeviceType.DimmableLight:
+                    {
+
+                        patm = "ZigeeLogic/dimmableLight.png";
+                        selectedpatm = "ZigeeLogic/selecteddimmableLight.png";
+                    }
+                    break;
+                case DeviceType.WindowCoveringDevice:
+                    {
+                        patm = "ZigeeLogic/curtain.png";
+                        selectedpatm = "ZigeeLogic/selectedcurtain.png";
+                    }
+                    break;
+                case DeviceType.Thermostat:
+                    {
+                        patm = "ZigeeLogic/ac.png";
+                        selectedpatm = "ZigeeLogic/selectedac.png";
+                    }
+                    break;
+                case DeviceType.AirSwitch:
+                    {
+                        patm = "ZigeeLogic/airswitch.png";
+                        selectedpatm = "ZigeeLogic/selectedairswitch.png";
+                    }
+                    break;
+            }
+            button.UnSelectedImagePath = patm;
+            button.SelectedImagePath = selectedpatm;
+        }
+        /// <summary>
+        /// 鏀寔鐨勮澶�
+        /// </summary>
+        /// <param name="type">鍒ゆ柇瀛楃涓�</param>
+        /// <returns></returns>
+        public static List<DeviceType> GetDevice(string type)
+        {
+            /// 璁惧绫诲瀷鍒楄〃
+            List<DeviceType> deviceTypeList = new List<DeviceType>();
+            deviceTypeList.Clear();
+            switch (type)
+            {
+                case "condition_logic":
+                    {//鑷姩鍖栨敮鎸佺殑鏉′欢璁惧
+                        deviceTypeList.Add(DeviceType.IASZone);
+                        deviceTypeList.Add(DeviceType.OnOffSwitch);
+                        deviceTypeList.Add(DeviceType.OnOffOutput);
+                        deviceTypeList.Add(DeviceType.DoorLock);
+                        deviceTypeList.Add(DeviceType.TemperatureSensor);
+                    }
+                    break;
+                case "action_logic":
+                    { //鑷姩鍖栨敮鎸佺殑鐩爣璁惧
+                        deviceTypeList.Add(DeviceType.OnOffOutput);
+                        deviceTypeList.Add(DeviceType.DimmableLight);
+                        deviceTypeList.Add(DeviceType.WindowCoveringDevice);
+                        deviceTypeList.Add(DeviceType.Thermostat);
+                        deviceTypeList.Add(DeviceType.AirSwitch);
+                    }
+                    break;
+                case "condition_mould":
+                    {
+                        //鑷姩鍖栨ā鏉挎敮鎸佺殑鏉′欢璁惧
+                        deviceTypeList.Add(DeviceType.IASZone);
+                    }
+                    break;
+                case "action_mould":
+                    { //鑷姩鍖栨ā鏉挎敮鎸佺殑鐩爣璁惧
+                        deviceTypeList.Add(DeviceType.OnOffOutput);
+                    }
+                    break;
+                case "action_lockaction":
+                    {//闂ㄩ攣鑱斿姩浜嬩欢鏀寔鐨勭洰鏍囪澶�
+                        deviceTypeList.Add(DeviceType.OnOffOutput);
+                        deviceTypeList.Add(DeviceType.DimmableLight);
+                        deviceTypeList.Add(DeviceType.WindowCoveringDevice);
+                        deviceTypeList.Add(DeviceType.Thermostat);
+                        deviceTypeList.Add(DeviceType.AirSwitch);
+                    }
+                    break;
+
+            }
+            return deviceTypeList;
+        }
+
+        /// <summary>
+        /// 鏇存柊鎵ц鍛ㄦ湡鐨勬柟娉�
+        /// </summary>
+        /// <param name="button">鏄剧ず鍛ㄦ湡鏂囨湰</param>
+        /// <param name="currentLogic">褰撳墠閫昏緫瀵硅薄</param>
+        public static void UpdateWeek(Button button, Common.Logic currentLogic)
+        {
+
+            switch (currentLogic.TimeAttribute.Repeat)
+            {
+                ///0:鍙墽琛屼竴娆★紝鎵ц鍚嶪sEnable鍊肩疆;1,浠婂勾鍐呮墽琛�;2锛氭瘡澶╂墽琛�;3锛氭瘡鏈堟墽琛�;4锛氭瘡骞存墽琛�;5锛氬懆閲嶅銆�
+                case 0:
+                    {
+                        button.Text = Language.StringByID(MyInternationalizationString.executeonce);
+                    }; break;
+                case 1: { }; break;
+                case 2:
+                    {
+                        button.Text = Language.StringByID(MyInternationalizationString.everyday);
+                    }; break;
+                case 3:
+                    {
+
+                        string len = "", value = "";
+                        var stringvalue = Convert.ToString(currentLogic.TimeAttribute.MonthDate, 2);
+                        var str = stringvalue.Insert(0, new string('0', 32 - stringvalue.Length));
+                        for (int j = 31; j >= 0; j--)
+                        {
+                            len += str.Substring(j, 1);
+                        }
+                        for (int j = 0; j < len.Length; j++)
+                        {
+                            var strvalue = len.Substring(j, 1);
+                            if (strvalue == "1")
+                            {
+                                value += (j + 1).ToString() + ",";
+                            }
+                        }
+                        button.Text = Language.StringByID(MyInternationalizationString.monthly) + value.TrimEnd(',') + Language.StringByID(MyInternationalizationString.day);
+
+                    }; break;
+                case 4:
+                    {
+
+                        Dictionary<int, int> dictionary = new Dictionary<int, int>();
+                        ///鎵惧嚭鎵ц鐨勬湀浠藉拰澶╂暟
+                        if (currentLogic.TimeAttribute.SelectMonDate.Count != 0)
+                        {
+                            for (int i = 0; i < currentLogic.TimeAttribute.SelectMonDate.Count; i++)
+                            {
+                                var dayvalue = currentLogic.TimeAttribute.SelectMonDate[i];
+                                if (dayvalue != 0)
+                                {
+                                    dictionary.Add(i + 1, dayvalue);
+                                }
+                            }
+                        }
+                        if (dictionary.Count != 0 && dictionary.Count == 1)
+                        {
+                            string len = "", leng = "";
+                            int minvalue = 0, Maximum = 0;
+                            foreach (var value in dictionary)
+                            {
+                                ///鍙栧嚭鏈堜唤
+                                var month = value.Key;
+                                ///鍙栧嚭鏃ユ暟
+                                var day = value.Value;
+                                var maxvalue = Convert.ToString(day, 2);
+                                var str = maxvalue.Insert(0, new string('0', 32 - maxvalue.Length));
+                                for (int j = 31; j >= 0; j--)
+                                {
+                                    len += str.Substring(j, 1);
+                                }
+
+                                for (int j = 0; j < len.Length; j++)
+                                {
+                                    var strvalue = len.Substring(j, 1);
+                                    if (strvalue == "1")
+                                    {
+                                        minvalue = j + 1;
+                                        break;
+                                    }
+                                }
+                                for (int j = 0; j < len.Length; j++)
+                                {
+                                    var strvalue = len.Substring(j, 1);
+                                    if (strvalue == "1")
+                                    {
+                                        Maximum = j + 1;
+                                    }
+                                }
+
+                                if (month.ToString().Length < 2)
+                                {
+                                    leng = "0" + month.ToString();
+                                }
+                                else
+                                {
+                                    leng = month.ToString();
+                                }
+                                if (minvalue == Maximum)
+                                {
+                                    button.Text = Language.StringByID(MyInternationalizationString.everyyear) + leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString());
+                                }
+                                else
+                                {
+                                    button.Text = Language.StringByID(MyInternationalizationString.everyyear) + leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString()) + "-" + leng + "/" + (Maximum.ToString().Length < 2 ? "0" + Maximum.ToString() : Maximum.ToString());
+                                }
+                            }
+
+                        }
+                        else
+                        {
+                            int b = 0;
+                            string stringtext = "";
+                            foreach (var value in dictionary)
+                            {
+                                string len = "", leng = "";
+                                int minvalue = 0, Maximum = 0;
+                                ///鍙栧嚭鏈堜唤
+                                var month = value.Key;
+                                ///鍙栧嚭鏃ユ暟
+                                var day = value.Value;
+                                var maxvalue = Convert.ToString(day, 2);
+                                var str = maxvalue.Insert(0, new string('0', 32 - maxvalue.Length));
+                                for (int j = 31; j >= 0; j--)
+                                {
+                                    len += str.Substring(j, 1);
+                                }
+
+
+                                if (month.ToString().Length < 2)
+                                {
+                                    leng = "0" + month.ToString();
+                                }
+                                else
+                                {
+                                    leng = month.ToString();
+                                }
+
+
+
+                                if (b == 0)
+                                {
+                                    for (int j = 0; j < len.Length; j++)
+                                    {
+                                        var strvalue = len.Substring(j, 1);
+                                        if (strvalue == "1")
+                                        {
+                                            minvalue = j + 1;
+                                            break;
+                                        }
+                                    }
+                                    stringtext += leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString()) + "-";
+
+                                }
+
+                                if (b == dictionary.Count - 1)
+                                {
+                                    for (int j = 0; j < len.Length; j++)
+                                    {
+                                        var strvalue = len.Substring(j, 1);
+                                        if (strvalue == "1")
+                                        {
+                                            Maximum = j + 1;
+                                        }
+                                    }
+                                    stringtext += leng + "/" + (Maximum.ToString().Length < 2 ? "0" + Maximum.ToString() : Maximum.ToString());
+
+                                }
+                                b++;
+                            }
+                            button.Text = Language.StringByID(MyInternationalizationString.everyyear) + stringtext;
+                        }
+
+                    }; break;
+                case 5:
+                    {
+                        string len = "", text = "";
+                        List<int> listvalueInt = new List<int>();
+                        listvalueInt.Clear();
+                        var maxvalue = Convert.ToString(currentLogic.TimeAttribute.WeekDay, 2);
+                        var str = maxvalue.Insert(0, new string('0', 8 - maxvalue.Length));
+                        for (int j = 7; j >= 0; j--)
+                        {
+                            len += str.Substring(j, 1);
+                        }
+
+                        for (int j = 0; j < len.Length; j++)
+                        {
+                            var strvalue = len.Substring(j, 1);
+                            if (strvalue == "1")
+                            {
+                                listvalueInt.Add(j + 1);
+
+
+                                if ((j + 1) == 1)
+                                {
+                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.mon1) + ",";
+                                    //text += Language.StringByID(MyInternationalizationString.mon) + ",";
+                                }
+                                else if ((j + 1) == 2)
+                                {
+                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.tue1) + ",";
+                                    //text += Language.StringByID(MyInternationalizationString.tue) + ",";
+                                }
+                                else if ((j + 1) == 3)
+                                {
+                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.wed1) + ",";
+                                    //text += Language.StringByID(MyInternationalizationString.wed) + ",";
+                                }
+                                else if ((j + 1) == 4)
+                                {
+                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.thu1) + ",";
+                                    //text += Language.StringByID(MyInternationalizationString.thu) + ",";
+                                }
+                                else if ((j + 1) == 5)
+                                {
+                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.frl1) + ",";
+                                    //text += Language.StringByID(MyInternationalizationString.frl) + ",";
+                                }
+                                else if ((j + 1) == 6)
+                                {
+                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.sat1) + ",";
+                                    //text += Language.StringByID(MyInternationalizationString.sat) + ",";
+                                }
+                                else if ((j + 1) == 7)
+                                {
+                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.sun1) + ",";
+                                    //text += Language.StringByID(MyInternationalizationString.sun) + ",";
+                                }
+
+
+                            }
+                        }
+                        //鏆傛椂闅愯棌鎺夛紝闇�瑕佹樉绀哄懆鏈拰宸ヤ綔鏃ュ啀鏀惧紑锛�
+                        //if (listvalueInt.Count == 5 && !listvalueInt.Contains(6) && !listvalueInt.Contains(7))
+                        //{
+                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.workingday);
+                        //}
+                        //else if (listvalueInt.Count == 2 && listvalueInt.Contains(6) && listvalueInt.Contains(7))
+                        //{
+                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.weekend);
+                        //}
+                        //else if (listvalueInt.Count == 7)
+                        //{
+                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.everyday);
+                        //}
+                        //else
+                        //{
+                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.week1) + text.Replace(Language.StringByID(MyInternationalizationString.week1), "").TrimEnd(',');
+                        //}
+                        button.Text = Language.StringByID(MyInternationalizationString.week1) + text.Replace(Language.StringByID(MyInternationalizationString.week1), "").TrimEnd(',');
+                        //btndisplaycycle.Text = text.TrimEnd(',');
+                    }; break;
+            }
+
+
+        }
+        /// <summary>
+        ///杩斿洖璁惧鐨勬柟娉�
+        /// </summary>
+        /// <param name="DeviceAddr">璁惧Mac</param>
+        /// <param name="Epoint">璁惧绔彛</param>
+        /// <returns></returns>
+        public static ZigBee.Device.CommonDevice GetCommonDevice(string DeviceAddr, string Epoint)
+        {
+
+            var device = Common.Logic.LogicDviceList.Find((obj) => { return ((obj.DeviceAddr == DeviceAddr) && (obj.DeviceEpoint.ToString() == Epoint)); });
+            if (device == null)
+            {
+                device = new ZigBee.Device.CommonDevice();
+            }
+            return device;
+        }
+        /// <summary>
+        /// 鎺ㄩ�佽缃殑鏂规硶
+        /// </summary>
+        /// <param name="middle"></param>
+        public static void Push(VerticalScrolViewLayout middle)
+        {
+            LogicView.Addview pushview = new LogicView.Addview();
+            pushview.switchBtn.Visible = true;
+            pushview.titleBtn.TextID = MyInternationalizationString.pushswitch;
+            middle.AddChidren(pushview.AddDeviceView());
+
+            LogicView.Addview custompushview = new LogicView.Addview();
+            custompushview.iconBtn.Visible = true;
+            custompushview.iconBtn.UnSelectedImagePath = "ZigeeLogic/next.png";
+            custompushview.titleBtn.TextID = MyInternationalizationString.custompush;
+            middle.AddChidren(custompushview.AddDeviceView());
+
+            EventHandler<MouseEventArgs> customclick = (sender, e) =>
+            {
+                var CustomText = new CustomText();
+                UserView.HomePage.Instance.AddChidren(CustomText);
+                UserView.HomePage.Instance.PageIndex += 1;
+                CustomText.Show();
+            };
+            custompushview.frameLayout.MouseUpEventHandler += customclick;
+            custompushview.clickBtn.MouseUpEventHandler += customclick;
+            // bool tag = false;//鏍囪寮�鍏崇姸鎬�;
+            pushview.clickBtn.MouseUpEventHandler += (sender1, e1) =>
+            {
+                pushview.switchBtn.IsSelected = !pushview.switchBtn.IsSelected;
+                if (pushview.switchBtn.IsSelected)
+                {
+                    LogicView.IfString.Tag = true;
+                    custompushview.frameLayout.Height = Application.GetRealHeight(160);
+                    Common.Logic.CurrentLogic.LogicIsCustomPushText = 1;
+
+                }
+                else
+                {
+                    LogicView.IfString.Tag = false;
+                    custompushview.frameLayout.Height = Application.GetRealHeight(0);
+                    Common.Logic.CurrentLogic.LogicIsCustomPushText = 0;
+                }
+                Send.Zj(LogicView.IfString.Tag, Common.Logic.CurrentLogic);
+            };
+
+            if (Common.Logic.CurrentLogic.LogicIsCustomPushText == 0)
+            {
+                LogicView.IfString.Tag = false;
+                pushview.switchBtn.IsSelected = false;
+                custompushview.frameLayout.Height = Application.GetRealHeight(0);
+            }
+            else
+            {
+                LogicView.IfString.Tag = true;
+                pushview.switchBtn.IsSelected = true;
+                custompushview.frameLayout.Height = Application.GetRealHeight(160);
+            }
+        }
+        /// <summary>
+        /// 淇濆瓨鑷姩鍖栫殑鏂规硶
+        /// </summary>
+        /// <param name="if_logic">鍒ゆ柇璺宠浆鐣岄潰鐨勫瓧绗︿覆</param>
+        /// <param name="name">閫昏緫鍚嶇О</param>
+        /// <param name="tag"></param>
+        /// <param name="CurrentLogic">褰撳墠閫昏緫</param>
+        public async static void SaveLogic(string if_logic, string name, bool tag, Common.Logic CurrentLogic)
+        {
+            if (string.IsNullOrEmpty(name))
+            {
+                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;
+            //}
+
+            CurrentLogic.LogicName = name;
+            bool succeed = false;
+            //鍒ゆ柇鏄柊娣诲姞閫昏緫(榛樿0)杩樻槸淇敼閫昏緫
+            CommonPage.Loading.Start();
+            if (CurrentLogic.LogicId == 0)
+            {
+                //鍙戦�佹坊鍔犻�昏緫鍛戒护
+                var logicifon = await Send.AddModifyLogic(CurrentLogic);
+                if (logicifon != null && logicifon.LogicId != 0)
+                {
+                    succeed = true;
+                    CurrentLogic.LogicId = logicifon.LogicId;
+                    Common.Logic.LogicList.Add(CurrentLogic);
+                    if (tag)
+                    {
+                        Send.Zj(tag, CurrentLogic);
+                    }
+                }
+            }
+            else
+            {
+                //鍙戦�佷慨鏀归�昏緫鍛戒护锛�
+                //淇敼鍛戒护涓嶉渶瑕佺瓑寰呭洖澶嶏紱
+                Send.AddModifyLogic(CurrentLogic);
+                //缂栬緫榛樿鎴愬姛锛堜笉鑰冭檻缃戠粶鎯呭喌锛夛紱
+                succeed = true;
+            }
+            CommonPage.Loading.Hide();
+
+            if (!succeed)//succeed鏍囪鏄坊鍔犳垚鍔熻繕鏄け璐�
+            {
+                //缃戝叧鍥炲澶辫触锛屼笉鍏抽棴鐣岄潰锛岃瀹冨仠鐣欏綋鍓嶇晫闈紱
+                //锛堝師鍥狅細鑰冭檻鍒板け璐ラ噸鏂扮紪杈戝師鏉ユ暟鎹粰鐢ㄦ埛甯︽潵浜嗛夯鐑︼級
+                ///鎻愮ず锛氭坊鍔犺嚜鍔ㄥ寲澶辫触锛�
+                //TipView("娣诲姞鑷姩鍖栧け璐�");
+                //return;
+            }
+            UserView.HomePage.Instance.RemoveViewByTag("Logic");
+            if (LogicView.IfString._Logic == if_logic)
+            {
+                Category.Category.instance?.RefreshBodyView();
+            }
+            else if (LogicView.IfString._LockLogic == if_logic)
+            {
+                var doorLockLogicList = new DoorLockLogic.LockLogicList();
+                UserView.HomePage.Instance.AddChidren(doorLockLogicList);
+                UserView.HomePage.Instance.PageIndex += 1;
+                doorLockLogicList.Show();
+            }
+
+        }
+
+    }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs
new file mode 100644
index 0000000..4075385
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/RoomAndDeviceView.cs
@@ -0,0 +1,452 @@
+锘縰sing System;
+using Shared.Common;
+using Shared.R;
+using Shared;
+using ZigBee.Device;
+using System.Collections.Generic;
+namespace Shared.Phone.Device.Logic
+{
+    public class RoomAndDeviceView : FrameLayout
+    {
+        public RoomAndDeviceView()
+        {
+            Tag = "Logic";
+        }
+        Button roombjButton = new Button();
+        Button roomTextButton = new Button();
+        Button devicetypeButton = new Button();
+        FrameLayout clickframeLayout = new FrameLayout();
+        Button clickbutton = new Button();
+        Button clicktextcolcrbutton = new Button();
+        /// <summary>
+        /// 鍒ゆ柇瀛楃
+        /// </summary>
+        public string IfType;
+        /// <summary>
+        /// 鎴块棿婊戝姩鐨勬帶浠�
+        /// </summary>
+        public HorizontalScrolViewLayout roomhorizontalScrol = new HorizontalScrolViewLayout
+        {
+            Width = Application.GetRealWidth(1080 - 58),
+            Height = Application.GetRealHeight(200),
+            X = Application.GetRealWidth(58),
+            Y = Application.GetRealHeight(184),
+        };
+        /// <summary>
+        /// 璁惧绫诲瀷婊戝姩鐨勬帶浠�
+        /// </summary>
+        public HorizontalScrolViewLayout devicetypehorizontalScrol = new HorizontalScrolViewLayout
+        {
+            Width = Application.GetRealWidth(1080 - 58),
+            Height = Application.GetRealHeight(280),
+            Y = Application.GetRealHeight(184 + 200),
+            BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
+            X = Application.GetRealWidth(58),
+            // Radius = (uint)Application.GetRealHeight(50),
+
+        };
+        /// <summary>
+        /// 鏄剧ず璁惧鍒楄〃鐨勬帶浠�
+        /// </summary>
+        public VerticalScrolViewLayout middle = new VerticalScrolViewLayout
+        {
+            X = Application.GetRealWidth(58),
+            Y = Application.GetRealHeight(184 + 200 + 280 + 40),
+            Height = Application.GetRealHeight(1920 - 40 - 184 - 280 - 200),
+            BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
+        };
+
+        public void Show(string Name)
+        {
+            #region  涓婇潰鐨勫竷灞�浠g爜
+            UserView.HomePage.Instance.ScrollEnabled = false;
+            this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView(true));
+            view.toptitleNameBtn.Text = Name; 
+            view.clickBtn.MouseDownEventHandler += (sender, e) =>
+            {
+                UserView.HomePage.Instance.ScrollEnabled = true;
+                RemoveFromParent();
+            };
+            view.foolrnameBtn.Text = Config.Instance.Home.GetCurrentFloorName;
+            if (Config.Instance.Home.FloorDics.Count < 2)
+            {
+                ///娌℃湁妤煎眰鎴栬�呭彧鏈変竴涓ゼ灞傦紝榛樿涓嶆樉绀哄浘鏍囧拰鏂囨湰;
+                view.foolrnameBtn.Visible = false;
+                view.dropdownBtn.Visible = false;
+                view.foolrclickBtn.Visible = false;
+            }
+            if (Config.Instance.Home.FloorDics.Count == 0)
+            {
+                Config.Instance.Home.CurrentFloorId = "";
+            }
+            #endregion
+
+            ///鎴块棿鍒楄〃
+            var roomlists = Method.GetRoomList(IfType, Config.Instance.Home.CurrentFloorId);
+            if (roomlists.Count == 0)
+            {
+                ///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱
+                return;
+            }
+            /// 璁惧绫诲瀷鍒楄〃
+            var deviceTypeList = Method.GetDevice(IfType);
+            this.AddChidren(roomhorizontalScrol);
+            this.AddChidren(devicetypehorizontalScrol);
+            this.AddChidren(middle);
+            devicetypehorizontalScrol.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerBottomLeft);
+            middle.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerTopLeft);
+            ///妤煎眰鐐瑰嚮浜嬩欢
+            view.foolrclickBtn.MouseUpEventHandler+= (sender, e) =>
+            {
+                var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
+                this.AddChidren(flMain);
+                flMain.MouseUpEventHandler += (sender2, e2) =>
+                {
+                    flMain.RemoveFromParent();
+                };
+                var foolrbjicon = new FrameLayout
+                {
+
+                    Width = Application.GetRealWidth(450),
+                    Height = Application.GetRealHeight(780),
+                    X = Application.GetRealWidth(1080 - 468 - 35),
+                    Y = Application.GetRealHeight(184),
+                    BackgroundImagePath = "Item/SelectFloor_Right.png",
+                };
+                flMain.AddChidren(foolrbjicon);
+
+                var btnfoolrtext = new Button
+                {
+                    Width = Application.GetRealWidth(450),
+                    Height = Application.GetRealHeight(150),
+                    TextAlignment = TextAlignment.CenterLeft,
+                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+                    X = Application.GetRealWidth(80),
+                    TextID = MyInternationalizationString.selecfoolr,
+                    TextSize = 14,
+                };
+                foolrbjicon.AddChidren(btnfoolrtext);
+
+                var foolrbj = new VerticalScrolViewLayout
+                {
+
+                    Width = Application.GetRealWidth(450),
+                    Height = foolrbjicon.Height - btnfoolrtext.Height,
+                    X = Application.GetRealWidth(80),
+                    Y = btnfoolrtext.Bottom,
+                };
+                foolrbjicon.AddChidren(foolrbj);
+
+                foreach (var foolr in Config.Instance.Home.FloorDics)
+                {
+                    var foolrRowLayout = new RowLayout
+                    {
+                        Height = Application.GetRealHeight(150),
+                        LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
+                    };
+                    foolrbj.AddChidren(foolrRowLayout);
+
+                    var btnfoolricon = new Button
+                    {
+                        Width = Application.GetRealWidth(81),
+                        Height = Application.GetRealHeight(81),
+                        UnSelectedImagePath = "Floor/Floor.png",
+                        Gravity = Gravity.CenterVertical,
+                    };
+                    foolrRowLayout.AddChidren(btnfoolricon);
+
+                    var btnfoolrname = new Button
+                    {
+                        Width = Application.GetRealWidth(250),
+                        Height = Application.GetRealHeight(150),
+                        Text = foolr.Value,
+                        TextAlignment = TextAlignment.CenterLeft,
+                        TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+                        Tag = foolr.Key,
+                        X = btnfoolricon.Right + Application.GetRealWidth(12),
+                        TextSize = 14,
+                    };
+                    foolrRowLayout.AddChidren(btnfoolrname);
+                    if (view.foolrnameBtn.Text == foolr.Value)
+                    {
+                        btnfoolricon.UnSelectedImagePath = "Floor/FloorSelected.png";
+                        btnfoolrname.TextColor = ZigbeeColor.Current.LogicTextBlackColor;
+                    }
+
+                    EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) =>
+                    {
+
+                        roomhorizontalScrol.RemoveAll();
+                        devicetypehorizontalScrol.RemoveAll();
+                        middle.RemoveAll();
+                        view.foolrnameBtn.Text = btnfoolrname.Text;
+                        flMain.RemoveFromParent();
+                        var list = Method.GetRoomList(IfType, btnfoolrname.Tag.ToString());
+                        if (list.Count == 0)
+                        {
+                            devicetypehorizontalScrol.Height= 0;
+                            middle.Height = 0;
+                        }
+                        else
+                        {
+                            devicetypehorizontalScrol.Height= Application.GetRealHeight(280);
+                            middle.Height= Application.GetRealHeight(1920 - 40 - 184 - 280 - 200);
+                        }
+                        AllRoomView(list, deviceTypeList);
+                    };
+                    foolrRowLayout.MouseUpEventHandler += foolrnameclick;
+                    btnfoolrname.MouseUpEventHandler += foolrnameclick;
+
+                }
+
+            };
+            AllRoomView(roomlists, deviceTypeList);
+        }
+        /// <summary>
+        /// 鍔犺浇鎵�鏈夋埧闂寸殑瑙嗗浘鏂规硶
+        /// </summary>
+        void AllRoomView(List<Common.Room> roomlist, List<DeviceType> deviceTypeList)
+        {
+            for (int i = 0; i < roomlist.Count; i++)
+            {
+                var room = roomlist[i];
+
+                var fra = new FrameLayout
+                {
+                    Height = Application.GetRealHeight(200),
+                    Width = Application.GetRealWidth(255),
+                };
+                roomhorizontalScrol.AddChidren(fra);
+
+                var roombjBtn = new Button
+                {
+                    Height = Application.GetRealHeight(158),
+                    Width = Application.GetRealWidth(255),
+                    UnSelectedImagePath = "ZigeeLogic/iconBackgroundColor.png",
+                    SelectedImagePath = "ZigeeLogic/iconSelectedBackgroundColor.png",
+                    Y = Application.GetRealHeight(21),
+                };
+                fra.AddChidren(roombjBtn);
+
+                var roomnameBtn = new Button
+                {
+
+                    Height = Application.GetRealHeight(152 - 26 - 20),
+                    Width = Application.GetRealWidth(255 - 20 - 50),
+                    Text = room.Name,
+                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
+                    SelectedTextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
+                    Y = Application.GetRealHeight(21 + 13 + 10),
+                    X = Application.GetRealWidth(10 + 25),
+
+                };
+                fra.AddChidren(roomnameBtn);
+
+                if (i == 0)//
+                {
+                    roombjButton.IsSelected = false;
+                    roombjButton = roombjBtn;
+                    roombjBtn.IsSelected = true;
+
+                    roomTextButton.IsSelected = false;
+                    roomTextButton = roomnameBtn;
+                    roomnameBtn.IsSelected = true;
+
+                    roombjBtn.IsSelected = true;
+                    roomnameBtn.IsSelected = true;
+
+                    var list = Method.GetDeviceUIList(room, deviceTypeList);
+                    AllDeviceTypeView(list);
+                }
+
+                EventHandler<MouseEventArgs> roomclick = (sender, e) =>
+                {
+                    roombjButton.IsSelected = false;
+                    roombjButton = roombjBtn;
+                    roombjBtn.IsSelected = true;
+
+                    roomTextButton.IsSelected = false;
+                    roomTextButton = roomnameBtn;
+                    roomnameBtn.IsSelected = true;
+
+
+                    var list = Method.GetDeviceUIList(room, deviceTypeList);
+                    AllDeviceTypeView(list);
+                };
+                roomnameBtn.MouseUpEventHandler += roomclick;
+                roombjBtn.MouseUpEventHandler += roomclick;
+
+            }
+        }
+        /// <summary>
+        /// 鍔犺浇璇ュ尯鍩熸墍鏈夎澶囪鍥炬柟娉�
+        /// </summary>0
+        /// <param name="devicelist">Devicelist.</param>
+        void AllDeviceTypeView(List<DeviceUI> devicelist)
+        {
+            var devicetypelist = Method.GetDeviceTypeList(IfType, devicelist);
+            devicetypehorizontalScrol.RemoveAll();
+            for (int i = 0; i < devicetypelist.Count; i++)
+            {
+                var devicetype = devicetypelist[i];
+                var spaceRowLayout = new FrameLayout();
+                devicetypehorizontalScrol.AddChidren(spaceRowLayout);
+                if (i == 0)
+                {
+                    spaceRowLayout.Width = Application.GetRealWidth(37);
+                }
+                else
+                {
+                    spaceRowLayout.Width = Application.GetRealWidth(80);
+                }
+
+                var deviceRowLayout = new FrameLayout
+                {
+                    Width = Application.GetRealWidth(156 + 20),
+                    Height = Application.GetRealHeight(280 - 30),
+                    Y = Application.GetRealHeight(30),
+                };
+                devicetypehorizontalScrol.AddChidren(deviceRowLayout);
+
+                var backgroundColor = new Button
+                {
+                    Width = Application.GetRealWidth(156),
+                    Height = Application.GetRealHeight(180),
+                    X = Application.GetRealWidth(10),
+                    UnSelectedImagePath = "ZigeeLogic/deviceunselectedbackgroundcolor.png",
+                    SelectedImagePath = "ZigeeLogic/deviceselectedbackgroundcolor.png",
+                };
+                deviceRowLayout.AddChidren(backgroundColor);
+
+
+                var devicetypeicon = new Button
+                {
+                    Width = Application.GetRealWidth(84),
+                    Height = Application.GetRealHeight(84),
+                    X = Application.GetRealWidth(46),
+                    Y = Application.GetRealHeight(30),
+                    UnSelectedImagePath =Method.GetDeviceTypeIcon(devicetype),
+                };
+                deviceRowLayout.AddChidren(devicetypeicon);
+
+                var devicetypename = new Button
+                {
+                    Width = Application.GetRealWidth(176),
+                    Height = Application.GetRealHeight(40),
+                    Text = devicetype,
+                    TextAlignment = TextAlignment.Center,
+                    Y = backgroundColor.Bottom,
+                    TextColor = ZigbeeColor.Current.LogicAddColor,
+                    TextSize = 10,
+                };
+                deviceRowLayout.AddChidren(devicetypename);
+               
+                EventHandler<MouseEventArgs> devicetypeclick = (sender13, e13) =>
+                {
+                    devicetypeButton.IsSelected = false;
+                    devicetypeButton = backgroundColor;
+                    backgroundColor.IsSelected = true;
+                    var list = Method.GetDeviceType(devicetypename.Text);
+                    ConditionDeviceView(list, devicelist);
+                };
+                deviceRowLayout.MouseUpEventHandler += devicetypeclick;
+                devicetypename.MouseUpEventHandler += devicetypeclick;
+                devicetypeicon.MouseUpEventHandler += devicetypeclick;
+                backgroundColor.MouseUpEventHandler += devicetypeclick;
+
+            }
+            ///鏄剧ず鎴块棿鎵�鏈夎澶�
+            ConditionDeviceView(new List<DeviceType>(), devicelist);
+
+        }
+        /// <summary>
+        /// 鍔犺浇璇ョ被鍨嬭澶囪鍥炬柟娉�
+        /// </summary>
+        /// <param name="deviceTypelist">Device typelist.</param>
+        /// <param name="devicelist">璁惧鍒楄〃</param>
+        void ConditionDeviceView(List<DeviceType> deviceTypelist, List<DeviceUI> devicelist)
+        {
+            middle.RemoveAll();
+            foreach (var common in devicelist)
+            {
+                if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.CommonDevice.Type))
+                {
+                    continue;
+                }
+                if (IfType == "condition_mould")
+                {
+                    if (common.CommonDevice.IasDeviceType != 13)
+                    {//鑷姩鍖栨ā鏉垮彧鏀寔绾㈠浼犳劅鍣�
+                        continue;
+                    }
+                }
+                var deviceFramelayout = new FrameLayout
+                {
+                    Height = Application.GetRealHeight(160),
+                };
+                middle.AddChidren(deviceFramelayout);
+                var bjFramelayout = new FrameLayout
+                {
+                    Width = Application.GetRealWidth(112),
+                    Height = Application.GetRealHeight(112),
+                    X = Application.GetRealWidth(58),
+                    Y = Application.GetRealHeight(30 + 9),
+                    // Radius = (uint)Application.GetRealHeight(56),
+                    BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
+                };
+                deviceFramelayout.AddChidren(bjFramelayout);
+                var deviceIconBtn = new Button
+                {
+                    Width = Application.GetRealWidth(82),
+                    Height = Application.GetRealHeight(82),
+                    Gravity = Gravity.Center,
+                };
+                bjFramelayout.AddChidren(deviceIconBtn);
+                Method.GetDeviceIcon(common, deviceIconBtn);
+                var deviceRow = new RowLayout
+                {
+                    Y = Application.GetRealHeight(30),
+                    Width = Application.GetRealWidth(850),
+                    Height = Application.GetRealHeight(130),
+                    X = Application.GetRealWidth(176 + 10),
+                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
+
+                };
+                deviceFramelayout.AddChidren(deviceRow);
+                var devicename = new Button
+                {
+                    Text = common.CommonDevice.DeviceEpointName,
+                    TextAlignment = TextAlignment.CenterLeft,
+                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
+                    SelectedTextColor = ZigbeeColor.Current.LogicAddColor,
+                    TextSize = 14,
+                };
+                deviceRow.AddChidren(devicename);
+                EventHandler<MouseEventArgs> devicclick = (sen, e) =>
+                {
+                    clickbutton.IsSelected = false;
+                    clickbutton = deviceIconBtn;
+                    deviceIconBtn.IsSelected = true;
+                    clickframeLayout.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
+                    clickframeLayout = bjFramelayout;
+                    bjFramelayout.BackgroundColor = ZigbeeColor.Current.LogicIconBackgroundColor;
+                    clicktextcolcrbutton.IsSelected = false;
+                    clicktextcolcrbutton = devicename;
+                    devicename.IsSelected = true;
+                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
+                    this.AddChidren(flMain);
+                    CurrentDeviceState.CurrentDeviceView(flMain, common.CommonDevice, false, IfType);
+
+                };
+                deviceFramelayout.MouseUpEventHandler += devicclick;
+                bjFramelayout.MouseUpEventHandler += devicclick;
+                deviceIconBtn.MouseUpEventHandler += devicclick;
+                deviceRow.MouseUpEventHandler += devicclick;
+                devicename.MouseUpEventHandler += devicclick;
+            }
+        }
+        
+    }
+}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs
index b232308..543c435 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/SecurityMode.cs
@@ -22,57 +22,14 @@
         {
 
             #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.securitymode,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent();
-            };
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.TextID = MyInternationalizationString.securitymode;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             #endregion
 
             var middle = new FrameLayout();
-            middle.Y = topRowLayout.Bottom;
+            middle.Y = view.topRowLayout.Bottom;
             middle.Height = Application.GetRealHeight(1920 - 184);
             middle.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
             this.AddChidren(middle);
@@ -367,18 +324,22 @@
                         }
                         else if (actions["SecuritySetting"].ToString() == "1")
                         {
-                            athomedefenceSelected.Visible = true;
-                            leavehomedefenceSelected.Visible = false;
-                            withdrawalSelected.Visible = false;
-                            urgentwithdrawalSelected.Visible = false;
-                        }
-                        else if (actions["SecuritySetting"].ToString() == "2")
-                        {
-                            athomedefenceSelected.Visible = false;
-                            leavehomedefenceSelected.Visible = true;
-                            withdrawalSelected.Visible = false;
-                            urgentwithdrawalSelected.Visible = false;
+                            if (actions["SecurityModeId"].ToString() == "1")
+                            {
 
+                                athomedefenceSelected.Visible = true;
+                                leavehomedefenceSelected.Visible = false;
+                                withdrawalSelected.Visible = false;
+                                urgentwithdrawalSelected.Visible = false;
+                            }
+                            else
+                            {
+                                athomedefenceSelected.Visible = false;
+                                leavehomedefenceSelected.Visible = true;
+                                withdrawalSelected.Visible = false;
+                                urgentwithdrawalSelected.Visible = false;
+
+                            }
                         }
                         break;
 
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SelectedLogic.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SelectedLogic.cs
deleted file mode 100644
index ac28ea7..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SelectedLogic.cs
+++ /dev/null
@@ -1,565 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared;
-using Shared.Phone;
-using Shared.R;
-using ZigBee.Device;
-
-namespace Shared.Phone.Device.Logic
-{
-    public class SelectedLogic : FrameLayout
-    {
-        public void Show (ZbGateway zbGateway)
-        {
-            UserView.HomePage.Instance.RemoveViewByTag ("Logic");
-            Tag = "Logic";
-
-
-            this.AddChidren (new Button {
-                Height = Application.GetRealHeight (30),
-                BackgroundColor = 0xFF1f1f1f,
-            });
-
-            var topFrameLayout = new FrameLayout {
-                Height = Application.GetRealHeight (100),
-                Y = Application.GetRealHeight (30),
-                BackgroundColor = 0xFF1F1F1F,
-            };
-            AddChidren (topFrameLayout);
-
-            var hdl = new Button {
-                Width = Application.GetRealWidth (104),
-                Height = Application.GetRealHeight (32),
-                X = Application.GetRealWidth (530),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "Logo/Logo.png",
-            };
-            //if (superGateWay.Tag != "LogicEdit") {
-            //    topFrameLayout.AddChidren (hdl);
-            //}
-
-            var titleName = new Button {
-                //Text = "鏃堕棿鏉′欢",
-                TextID = MyInternationalizationString.Timecondition,
-                TextSize = 17,
-                IsBold = true,
-            };
-            topFrameLayout.AddChidren (titleName);
-
-            var back = new Button {
-                Width = Application.GetRealWidth (82),
-                Height = Application.GetRealHeight (89),
-                X = Application.GetRealWidth (10),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "MusicIcon/HomepageBack.png",
-            };
-            //if (logicedit.Tag == "true") {
-            //    topFrameLayout.AddChidren (back);
-            //}
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent ();
-
-            };
-
-            var middle = new VerticalScrolViewLayout ();
-            middle.Y = topFrameLayout.Bottom;
-            middle.Height = Application.GetRealHeight (1136 - 130 - 80);
-            middle.BackgroundColor = 0xff2F2F2F;
-            this.AddChidren (middle);
-
-            var conditionRowLayout = new RowLayout {
-                Height = Application.GetRealHeight (100),
-                BackgroundColor = 0xff323232,
-            };
-            middle.AddChidren (conditionRowLayout);
-            ///鏉′欢VerticalScrolViewLayout
-            var inputVerticalScrolViewLayout = new VerticalScrolViewLayout {
-                Height = 0,
-                BackgroundColor = 0xffffffff,
-            };
-            middle.AddChidren (inputVerticalScrolViewLayout);
-            conditionRowLayout.AddChidren (new Button {
-                Width = Application.GetRealWidth (200),
-                //Text = "鏉′欢",
-                TextID = MyInternationalizationString.condition,
-                TextSize = 16,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth (40),
-                Gravity = Gravity.CenterVertical,
-            });
-
-            var conditionadd = new Button {
-                Width = Application.GetRealWidth (72),
-                Height = Application.GetRealHeight (58),
-                UnSelectedImagePath = "MusicIcon/add.png",
-                X = Application.GetRealWidth (525),
-                Gravity = Gravity.CenterVertical,
-            };
-            conditionRowLayout.AddChidren (conditionadd);
-           
-            #region -----鏄剧ず閫昏緫鏉′欢-----
-            //inputVerticalScrolViewLayout.Height = Application.GetRealHeight (100 * (logicedit.input.Count + logicedit.time.Count));
-            //for (int i = 0; i < logicedit.time.Count; i++) {
-            //    var s = logicedit.time [i];
-            //    var timerowLayout = new RowLayout {
-            //        Height = Application.GetRealHeight (100),
-            //        BackgroundColor = 0xff505050,
-            //    };
-            //    inputVerticalScrolViewLayout.AddChidren (timerowLayout);
-
-            //    ///鏄剧ず鏃堕棿
-            //    var timevalue = new Button {
-            //        X = Application.GetRealWidth (40),
-            //        Width = Application.GetRealWidth (300),
-            //        TextAlignment = TextAlignment.CenterLeft,
-            //        Gravity = Gravity.CenterVertical,
-            //        Text = s,
-            //        //TextColor = 0xff121212,
-            //    };
-            //    timerowLayout.AddChidren (timevalue);
-                               
-            //}
-
-            //foreach (var deviceinput in logicedit.input) {
-            //    if (deviceinput.sid == null || deviceinput.sid == "") {
-            //        continue;
-            //    }
-            //    var tempSid = deviceinput.sid;
-            //    //鍒ゆ柇SID鏄惁鏈夋晥鐨勶紝濡傛灉涓嶆槸鏈夋晥鐨勫綋鍓嶈繖涓満鏅暟鎹氨涓嶅鐞�
-            //    Convert.ToUInt64 (tempSid, 16);
-            //    var sidUlong = Convert.ToUInt64 (tempSid, 16);
-            //    ///1:璁惧;2:鍦烘櫙;3:閫昏緫;
-            //    var type = (byte)((sidUlong >> 60) & 0xF);
-            //    var statevalue = deviceinput.value.ToString ();
-
-            //    var inputrowLayout = new RowLayout {
-            //        Height = Application.GetRealHeight (100),
-            //        BackgroundColor = 0xff505050,
-            //    };
-            //    inputVerticalScrolViewLayout.AddChidren (inputrowLayout);
-
-            //    ///鏄剧ず璁惧鍚嶇О
-            //    var devicename = new Button {
-            //        X = Application.GetRealWidth (40),
-            //        Width = Application.GetRealWidth (300),
-            //        TextAlignment = TextAlignment.CenterLeft,
-            //        Gravity = Gravity.CenterVertical,
-            //        //TextColor = 0xff121212,
-            //    };
-            //    inputrowLayout.AddChidren (devicename);
-
-            //    ///鏄剧ず璁惧鏉′欢鐘舵�佹帶浠�
-            //    var devicestatus = new Button {
-            //        Width = Application.GetRealWidth (130),
-            //        Height = Application.GetRealHeight (100),
-            //        Gravity = Gravity.CenterVertical,
-            //        //TextColor = 0xff121212,
-            //        X = Application.GetRealWidth (500),
-            //    };
-            //    inputrowLayout.AddChidren (devicestatus);
-                              
-            //    switch (type) {
-            //    case 1: {
-            //            var subnetId = (byte)((sidUlong >> 40) & 0xFF);
-            //            var deviceId = (byte)((sidUlong >> 32) & 0xFF);
-            //            var targetType = (byte)((sidUlong >> 24) & 0xFF);
-            //            var property = (byte)((sidUlong >> 16) & 0xFF);
-            //            var targetNumber = (uint)((sidUlong >> 0) & 0xFFFF);
-            //            ///鐢ㄦ潵鍒ゆ柇涓烘潯浠讹紝鏌ユ壘褰撳墠璁惧锛�
-            //            var commonLoopID = subnetId + "_" + deviceId + "_" + targetNumber;
-            //            var Type = Logic.devicetype (targetType, property);
-
-            //            var commonDevice = superGateWay.Commons.Find ((obj) => obj.Type.ToString () == Type && obj.CommonLoopID == commonLoopID);
-            //            if (commonDevice == null) {
-            //                continue;
-            //            }
-            //            devicename.Text = commonDevice.Name;
-
-            //            try {
-            //                switch (commonDevice.Type) {
-            //                case DeviceType.CurtainModel: {
-            //                        if (statevalue == "1") {
-            //                            devicestatus.Text = Language.StringByID (MyInternationalizationString.open);
-            //                        } else {
-            //                            devicestatus.Text = Language.StringByID (MyInternationalizationString.close);
-            //                        }
-            //                    }
-            //                    break;
-            //                case DeviceType.CurtainRoller: {
-            //                        devicestatus.Text = statevalue + "%";
-            //                    }
-            //                    break;
-            //                case DeviceType.LightDimming: {
-            //                        devicestatus.Text = statevalue + "%";
-            //                    }
-            //                    break;
-            //                case DeviceType.LightSwitch: {
-            //                        if (statevalue == "1") {
-            //                            devicestatus.Text = Language.StringByID (MyInternationalizationString.open);
-            //                        } else {
-            //                            devicestatus.Text = Language.StringByID (MyInternationalizationString.close);
-            //                        }
-
-            //                    }
-            //                    break;
-            //                case DeviceType.HVAC: {
-
-            //                        if (property == 0) {
-
-            //                            if (statevalue == "1") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.open);
-            //                            } else {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.close);
-            //                            }
-
-            //                        } else if (property == 1) {
-            //                            if (statevalue == "0") {
-            //                                //鍒跺喎
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.Cool);
-            //                            } else if (statevalue == "1") {
-            //                                //鍒剁儹
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.Hot);
-            //                            } else if (statevalue == "2") {
-            //                                //閫氶
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.Ventila);
-            //                            } else if (statevalue == "3") {
-            //                                //鑷姩
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.Auto);
-            //                            } else if (statevalue == "4") {
-            //                                //鎶芥箍
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.Dehumidify);
-            //                            }
-            //                        } else if (property == 3) {
-            //                            //绌鸿皟娓╁害
-            //                            devicestatus.Text = statevalue + "%";
-            //                        } else if (property == 5) {
-            //                            //鐜娓╁害
-            //                            devicestatus.Text = statevalue + "%";
-            //                        }
-            //                    }
-            //                    break;
-            //                case DeviceType.FoolHeat: {
-            //                        if (property == 0) {
-            //                            if (statevalue == "1") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.open);
-            //                            } else {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.close);
-            //                            }
-            //                        } else if (property == 2) {
-            //                            devicestatus.Text = statevalue + "鈩�";
-            //                        }
-            //                    }
-            //                    break;
-            //                case DeviceType.FreshAir: {
-            //                        if (property == 0) {
-            //                            if (statevalue == "1") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.open);
-            //                            } else {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.close);
-            //                            }
-            //                        } else if (property == 1) {
-            //                            if (statevalue == "0") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.Smart);
-            //                            } else if (statevalue == "1") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.FreshAir);
-            //                            } else if (statevalue == "2") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.InternalCirculation);
-            //                            } else if (statevalue == "3") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.ConstantTemp);
-            //                            }
-            //                        }
-            //                    }
-            //                    break;
-            //                case DeviceType.MechanicalSwitch: {
-            //                        if (property == 0) {
-            //                            if (statevalue == "1") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.open);
-            //                            } else {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.close);
-            //                            }
-            //                        }
-            //                    }
-            //                    break;
-            //                case DeviceType.AutomaticSwitch: {
-            //                        if (property == 1) {
-            //                            if (statevalue == "1") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.singleclick);
-            //                            } else if (statevalue == "2") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.longpress);
-            //                            } else if (statevalue == "3") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.longpressrelease);
-            //                            } else if (statevalue == "4") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.doubleclick);
-            //                            }
-            //                        }
-            //                    }
-            //                    break;
-            //                case DeviceType.DryContact: {
-            //                        if (property == 0) {
-            //                            if (statevalue == "1") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.open);
-            //                            } else {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.close);
-            //                            }
-            //                        }
-            //                    }
-            //                    break;
-            //                case DeviceType.MusicModel: {
-            //                        if (property == 0) {
-            //                            if (statevalue == "1") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.play);
-            //                            } else if (statevalue == "2") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.pause);
-            //                            }
-            //                        } else if (property == 1) {
-            //                            //devicestatus.Text = Language.StringByID (MyInternationalizationString.close);
-            //                            devicestatus.Text = statevalue + "%";
-            //                        }
-            //                    }
-            //                    break;
-            //                case DeviceType.DoorLock: {
-            //                        if (property == 0) {
-            //                            if (statevalue == "1") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.open);
-            //                            } else {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.close);
-            //                            }
-            //                        } else if (property == 1) {
-            //                            if (statevalue == "1") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.low);
-            //                            } else {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.normal);
-            //                            }
-            //                        } else if (property == 2) {
-            //                            if (statevalue == "1") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.trigger);
-            //                            } else {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.nontrigger);
-            //                            }
-            //                        }
-            //                    }
-            //                    break;
-            //                case DeviceType.DoorLockID: {
-            //                        if (property == 0) {
-            //                            if (statevalue == "1") {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.trigger);
-            //                            } else {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.nontrigger);
-            //                            }
-            //                        }
-            //                    }
-            //                    break;
-            //                case DeviceType.Sensor: {
-            //                        if (property == 0) {
-            //                            devicestatus.Text = statevalue + "鈩�";
-            //                        } else if (property == 1) {
-            //                            devicestatus.Text = statevalue + "%";
-            //                        } else if (property == 5) {
-            //                            int intvalue = 90;
-            //                            intvalue = int.Parse (statevalue);
-            //                            if (0 <= intvalue && intvalue < 60) {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.difference);
-            //                            } else if (60 <= intvalue && intvalue < 75) {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.middle);
-            //                            } else if (75 <= intvalue && intvalue <= 100) {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.excellent);
-            //                            }
-            //                        } else if (property == 10) {
-            //                            int intvalue = 90;
-            //                            intvalue = int.Parse (statevalue);
-            //                            if (0 <= intvalue && intvalue < 60) {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.difference);
-            //                            } else if (60 <= intvalue && intvalue < 75) {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.middle);
-            //                            } else if (75 <= intvalue && intvalue <= 100) {
-            //                                devicestatus.Text = Language.StringByID (MyInternationalizationString.excellent);
-            //                            }
-            //                        }
-            //                    }
-            //                    break;
-            //                }
-            //            } catch { }
-                       
-            //        }
-            //        break;
-            //    case 3: {
-            //            var logic = superGateWay.Logics.Find ((obj) => obj.sid == tempSid);
-            //            if (logic == null) {
-            //                continue;
-            //            }
-            //            devicename.Text = logic.name;
-            //            if (statevalue == "1") {
-            //                devicestatus.Text = Language.StringByID (MyInternationalizationString.open1);
-            //            } else {
-            //                devicestatus.Text = Language.StringByID (MyInternationalizationString.disable);
-            //            }
-
-            //          }
-            //        break;
-
-            //    }
-
-            //}
-            #endregion
-
-            var targetRowLayout = new RowLayout {
-                Height = Application.GetRealHeight (100),
-                BackgroundColor = 0xff323232,
-            };
-            middle.AddChidren (targetRowLayout);
-            ///鐩爣targetVerticalScrolViewLayout
-            var targetVerticalScrolViewLayout = new VerticalScrolViewLayout {
-                Height = 0,
-                BackgroundColor = 0xffffffff,
-            };
-            middle.AddChidren (targetVerticalScrolViewLayout);
-
-            var btntargettitle = new Button {
-                // Text = "鎵ц鐩爣",
-                TextSize = 16,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth (40),
-                Gravity = Gravity.CenterVertical,
-                TextID = MyInternationalizationString.Implementationgoals,
-            };
-            targetRowLayout.AddChidren (btntargettitle);
-
-            var btntargetadd = new Button {
-                Width = Application.GetRealWidth (72),
-                Height = Application.GetRealHeight (58),
-                UnSelectedImagePath = "MusicIcon/add.png",
-                X = Application.GetRealWidth (525),
-                Gravity = Gravity.CenterVertical,
-            };
-            targetRowLayout.AddChidren (btntargetadd);
-           
-            #region  ----鏄剧ず鎵ц鐩爣----
-            //foreach (var deviceoutput in logicedit.output) {
-            //    targetVerticalScrolViewLayout.Height = Application.GetRealHeight (100 * deviceoutput.objects.Count);
-            //    foreach (var device in deviceoutput.objects) {
-            //        if (!device.ContainsKey ("sid")) {
-            //            continue;
-            //        }
-            //        var tempSid = device ["sid"]?.ToString ();
-            //        if (tempSid == "") {
-            //            continue;
-            //        }
-            //        //鍒ゆ柇SID鏄惁鏈夋晥鐨勶紝濡傛灉涓嶆槸鏈夋晥鐨勫綋鍓嶈繖涓満鏅暟鎹氨涓嶅鐞�
-            //        Convert.ToUInt64 (tempSid, 16);
-            //        var sidUlong = Convert.ToUInt64 (tempSid, 16);
-            //        ///1:璁惧;2:鍦烘櫙;3:閫昏緫;
-            //        var type = (byte)((sidUlong >> 60) & 0xF);
-            //        string delay = "";
-            //        string statevalue = "";
-            //        if (device.ContainsKey ("value")) {
-            //            statevalue = device ["value"]?.ToString ();
-            //        }
-            //        if (device.ContainsKey ("delay")) {
-            //            delay = device ["delay"]?.ToString ();
-            //        }
-
-            //        var inputrowLayout = new RowLayout {
-            //            Height = Application.GetRealHeight (100),
-            //            BackgroundColor = 0xff505050,
-            //        };
-            //        targetVerticalScrolViewLayout.AddChidren (inputrowLayout);
-
-            //        var devicename = new Button {
-            //            // Text = device.Name,
-            //            X = Application.GetRealWidth (40),
-            //            Width = Application.GetRealWidth (300),
-            //            TextAlignment = TextAlignment.CenterLeft,
-            //            Gravity = Gravity.CenterVertical,
-            //            //TextColor = 0xff121212,
-            //        };
-            //        inputrowLayout.AddChidren (devicename);
-
-            //        var btndelay = new Button {
-            //            Width = Application.GetRealWidth (150),
-            //            Height = Application.GetRealHeight (50),
-            //            X = Application.GetRealWidth (300),
-            //            Y = Application.GetRealHeight (25),
-            //            TextAlignment = TextAlignment.Center,
-            //            TextColor = 0xffcccccc,
-            //        };
-            //        inputrowLayout.AddChidren (btndelay);
-
-                   
-
-
-            //        if (delay != "" && delay != "0") {
-            //            var l = int.Parse (delay) / 10;
-            //            btndelay.Text = l.ToString () + "s";
-            //        }
-
-            //        ///鏄剧ず璁惧鐘舵�佹帶浠�
-            //        var devicestatus = new Button {
-            //            Width = Application.GetRealWidth (130),
-            //            Height = Application.GetRealHeight (100),
-            //            Gravity = Gravity.CenterVertical,
-            //            //TextColor = 0xff121212,
-            //            X = Application.GetRealWidth (500),
-            //        };
-            //        inputrowLayout.AddChidren (devicestatus);
-
-                  
-            //    }
-
-            //}
-            #endregion
-
-            var cyclerowlayout = new RowLayout {
-                Height = Application.GetRealHeight (100),
-                BackgroundColor = 0xff323232,
-            };
-            middle.AddChidren (cyclerowlayout);
-            ///鎵ц鍛ㄦ湡
-            var btncycle = new Button {
-                TextSize = 16,
-                //Text = "鎵ц鍛ㄦ湡",
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth (40),
-                Width = Application.GetRealWidth (210),
-                Gravity = Gravity.CenterVertical,
-                TextID = MyInternationalizationString.cycle
-            };
-            cyclerowlayout.AddChidren (btncycle);
-            ///鏄剧ず鍛ㄦ湡鏃堕棿
-            var btndisplaycycle = new Button {
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth (250),
-                Width = Application.GetRealWidth (300),
-                Gravity = Gravity.CenterVertical,
-            };
-            cyclerowlayout.AddChidren (btndisplaycycle);
-            ///鏇存柊鍛ㄦ湡鐨勬柟娉�
-
-            var btncycleback = new Button {
-                Width = Application.GetRealWidth (87),
-                Height = Application.GetRealHeight (100),
-                UnSelectedImagePath = "MusicIcon/Next.png",
-                SelectedImagePath = "MusicIcon/NextSelecte.png",
-                X = Application.GetRealWidth (525),//550
-            };
-            cyclerowlayout.AddChidren (btncycleback);
-
-            var btncomplete = new Button {
-                Height = Application.GetRealHeight (80),
-                Y = middle.Bottom,
-                TextID = MyInternationalizationString.complete,
-                TextSize = 16,
-                BackgroundColor = 0xff1f1f1f,
-            };
-            AddChidren (btncomplete);
-            btncomplete.MouseUpEventHandler += (sender, e) => {
-                var logicCommunalPage = new LogicCommunalPage ();
-                UserView.HomePage.Instance.AddChidren (logicCommunalPage);
-                logicCommunalPage.Show (() => { });
-
-            };
-           
-        }
-
-       
-    }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SelectedLogicState.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SelectedLogicState.cs
deleted file mode 100644
index f81143f..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SelectedLogicState.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared;
-using Shared.Common;
-using Shared.Phone;
-using Shared.R;
-using ZigBee.Device;
-
-namespace Shared.Phone.Device.Logic
-{
-    public class SelectedLogicState : FrameLayout
-    {
-        public SelectedLogicState ()
-        {
-            Tag = "Logic";
-        }
-        public bool IsDeviceEditor;
-        Dictionary<string,object> actionsInfo = new Dictionary<string, object>();
-        public void Show (Common.Logic currlogicIfon)
-        {
-            this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor;
-            this.AddChidren (new Button {
-                Height = Application.GetRealHeight (80),
-            });
-
-            var topFrameLayout = new FrameLayout {
-                Height = Application.GetRealHeight (140),
-                Y = Application.GetRealHeight (80),
-            };
-            AddChidren (topFrameLayout);
-
-            var titleName = new Button {
-                TextID = MyInternationalizationString.automation,
-                TextSize = 16,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                IsBold = true,
-            };
-            topFrameLayout.AddChidren (titleName);
-
-            var back = new Button {
-                Width = Application.GetRealWidth (110),
-                Height = Application.GetRealHeight (110),
-                X = Application.GetRealWidth (20),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "ZigeeLogic/Back.png",
-            };
-            topFrameLayout.AddChidren (back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent ();
-                IsDeviceEditor = false;
-            };
-
-            var tetleframeLayout = new FrameLayout {
-                Y = topFrameLayout.Bottom,
-                Height = Application.GetRealHeight (180),
-                //BackgroundColor = 0xff0f0f0f,
-            };
-            AddChidren (tetleframeLayout);
-
-            var tetlebtn = new Button {
-                Width = Application.GetRealWidth (600),
-                TextID = MyInternationalizationString.selectsavedautomationstate,
-                //Text = "璇烽�夋嫨宸蹭繚瀛樿嚜鍔ㄥ寲",
-                TextSize = 16,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth (40),
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-            };
-            tetleframeLayout.AddChidren (tetlebtn);
-
-            var middle = new VerticalScrolViewLayout ();
-            middle.Y = tetleframeLayout.Bottom;
-            middle.Height = Application.GetRealHeight (1920 - 220 - 180 - 174);
-            middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
-            this.AddChidren (middle);
-
-
-
-
-
-            var openRowLayout = new RowLayout {
-                Height = Application.GetRealHeight (180),
-            };
-            middle.AddChidren (openRowLayout);
-
-            var btnlogicopen = new Button {
-                Width = Application.GetRealWidth (600),
-                TextID = MyInternationalizationString.open1,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth (40),
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-            };
-            openRowLayout.AddChidren (btnlogicopen);
-
-            string IsselectedLogic = null;
-            var disableRowLayout = new RowLayout {
-                Height = Application.GetRealHeight (180),
-            };
-            middle.AddChidren (disableRowLayout);
-
-            var btnlogicdisable = new Button {
-                Width = Application.GetRealWidth (600),
-                TextID = MyInternationalizationString.disable,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth (40),
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-
-            };
-            disableRowLayout.AddChidren (btnlogicdisable);
-
-            ///寮�鍚偣鍑讳簨浠�
-            EventHandler<MouseEventArgs> copenclick = (seder, e) => {
-                openRowLayout.BackgroundColor = 0xfffe5e00;
-                disableRowLayout.BackgroundColor = 0x00000000;
-                IsselectedLogic = "true";
-                if(actionsInfo.ContainsKey("EnableLogic")){
-                    actionsInfo.Remove("EnableLogic");
-                }
-                actionsInfo.Add("EnableLogic",1);
-
-            };
-            openRowLayout.MouseUpEventHandler += copenclick;
-            btnlogicopen.MouseUpEventHandler += copenclick;
-
-            ///绂佹鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> disableclick = (seder, e) =>
-            {
-                openRowLayout.BackgroundColor = 0x00000000;
-                disableRowLayout.BackgroundColor = 0xfffe5e00;
-                IsselectedLogic = "false";
-                if (actionsInfo.ContainsKey("EnableLogic"))
-                {
-                    actionsInfo.Remove("EnableLogic");
-                }
-                actionsInfo.Add("EnableLogic", 0);
-            };
-            disableRowLayout.MouseUpEventHandler += disableclick;
-            btnlogicdisable.MouseUpEventHandler += disableclick;
-
-            if(IsDeviceEditor){
-                foreach (var actions in Common.Logic.CurrentLogic.Actions)
-                {
-                    if (currlogicIfon.LogicId.ToString()==actions["DeviceAddr"].ToString() && actions["LinkType"].ToString() == "4")
-                    {
-                        if (actions["EnableLogic"].ToString()== "1")
-                        {
-                            openRowLayout.BackgroundColor = 0xfffe5e00;
-                            disableRowLayout.BackgroundColor = 0x00000000;
-                        }
-                        else
-                        {
-                            openRowLayout.BackgroundColor = 0x00000000;
-                            disableRowLayout.BackgroundColor = 0xfffe5e00;
-                        }
-                        break;
-                    }
-                }
-
-            };
-
-
-            var btncomplete = new Button {
-                Y = middle.Bottom,
-                Height = Application.GetRealHeight (174),
-                TextID = MyInternationalizationString.complete,
-                TextSize=16,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-            };
-            AddChidren (btncomplete);
-
-            if (actionsInfo.ContainsKey("DeviceAddr"))
-            {
-                actionsInfo.Remove("DeviceAddr");
-            }
-            if (actionsInfo.ContainsKey("LinkType"))
-            {
-                actionsInfo.Remove("LinkType");
-            }
-            actionsInfo.Add("DeviceAddr", currlogicIfon.LogicId);
-            actionsInfo.Add("LinkType", 4);
-
-            btncomplete.MouseUpEventHandler += (sedder, e) => {
-                if (IsselectedLogic != null) {
-                    LogicIfon.AddLogicactions(currlogicIfon,actionsInfo);
-                } else {
-                    if (!IsDeviceEditor) {
-                        var alert = new Alert (Language.StringByID (MyInternationalizationString.Prompt),
-                                              Language.StringByID (MyInternationalizationString.selectlogiccondition),
-                                               Language.StringByID(MyInternationalizationString.complete));
-                        alert.Show ();
-                        return;
-                    }
-                    IsDeviceEditor = false;
-                }
-                this.RemoveFromParent ();
-                var logicCommunalPage = new LogicCommunalPage ();
-                UserView.HomePage.Instance.AddChidren (logicCommunalPage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                logicCommunalPage.Show (() => { });
-            };
-        }
-
-    }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SelectedLogicStatus.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SelectedLogicStatus.cs
deleted file mode 100644
index 89c84c6..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SelectedLogicStatus.cs
+++ /dev/null
@@ -1,209 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared;
-using Shared.Common;
-using Shared.Phone;
-using Shared.R;
-using ZigBee.Device;
-namespace Shared.Phone.Device.Logic
-{
-    class SelectedLogicStatus:FrameLayout
-    {
-        public SelectedLogicStatus ()
-        {
-            Tag = "Logic";
-        }
-        public bool IsDeviceEditor;
-        Dictionary<string, string> logicConditionsInfo = new Dictionary<string, string>();
-
-        public void Show (Common.Logic logic)
-        {
-            this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor;
-            this.AddChidren (new Button {
-                Height = Application.GetRealHeight (80),
-            });
-          
-            var topFrameLayout = new FrameLayout {
-                Height = Application.GetRealHeight (140),
-                Y = Application.GetRealHeight (80),
-            };
-            AddChidren (topFrameLayout);
-
-            var titleName = new Button {
-                TextID = MyInternationalizationString.automation,
-                TextSize = 16,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                IsBold = true,
-            };
-            topFrameLayout.AddChidren (titleName);
-
-            var back = new Button {
-                Width = Application.GetRealWidth (110),
-                Height = Application.GetRealHeight (110),
-                X = Application.GetRealWidth (20),
-                Gravity = Gravity.CenterVertical,
-                UnSelectedImagePath = "ZigeeLogic/Back.png",
-            };
-            topFrameLayout.AddChidren (back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent ();
-                IsDeviceEditor = false;
-            };
-
-            var tetleframeLayout = new FrameLayout {
-                Y = topFrameLayout.Bottom,
-                Height = Application.GetRealHeight (180),
-                //BackgroundColor = 0xff0f0f0f,
-            };
-            AddChidren (tetleframeLayout);
-
-            var tetlebtn = new Button {
-                Width = Application.GetRealWidth (700),
-                TextID = MyInternationalizationString.selectsavedautomationstate,
-                //Text = "璇烽�夋嫨宸蹭繚瀛樿嚜鍔ㄥ寲",
-                TextSize = 16,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth (40),
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-            };
-            tetleframeLayout.AddChidren (tetlebtn);
-
-            var middle = new VerticalScrolViewLayout ();
-            middle.Y = tetleframeLayout.Bottom;
-            middle.Height = Application.GetRealHeight (1920 - 220 - 180 - 174);
-            middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
-            this.AddChidren (middle);
-
-
-
-            var openRowLayout = new RowLayout {
-                Height = Application.GetRealHeight (180),
-            };
-            middle.AddChidren (openRowLayout);
-
-            var btnlogicopen = new Button {
-                Width = Application.GetRealWidth (600),
-                TextID = MyInternationalizationString.open1,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth (40),
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-            };
-            openRowLayout.AddChidren (btnlogicopen);
-
-            string IsselectedLogic = null;
-            var disableRowLayout = new RowLayout {
-                Height = Application.GetRealHeight (180),
-            };
-            middle.AddChidren (disableRowLayout);
-
-            var btnlogicdisable = new Button {
-                Width = Application.GetRealWidth (600),
-                TextID = MyInternationalizationString.disable,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth (40),
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-            };
-            disableRowLayout.AddChidren (btnlogicdisable);
-
-            ///寮�鍚偣鍑讳簨浠�
-            EventHandler<MouseEventArgs> copenclick = (seder, e) => {
-                openRowLayout.BackgroundColor = 0xfffe5e00;
-                disableRowLayout.BackgroundColor = 0x00000000;
-                IsselectedLogic = "true";
-                if (logicConditionsInfo.ContainsKey("IsValid"))
-                {
-                    logicConditionsInfo.Remove("IsValid");
-                }
-                logicConditionsInfo.Add("IsValid","1");
-            };
-            openRowLayout.MouseUpEventHandler += copenclick;
-            btnlogicopen.MouseUpEventHandler += copenclick;
-
-            ///绂佹鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> disableclick = (seder, e) => {
-                openRowLayout.BackgroundColor = 0x00000000;
-                disableRowLayout.BackgroundColor = 0xfffe5e00;
-                IsselectedLogic = "false";
-                if(logicConditionsInfo.ContainsKey("IsValid")){
-                    logicConditionsInfo.Remove("IsValid");
-                }
-                logicConditionsInfo.Add("IsValid", "0");
-            };
-            disableRowLayout.MouseUpEventHandler += disableclick;
-            btnlogicdisable.MouseUpEventHandler += disableclick;
-
-            if (IsDeviceEditor)
-            {
-                foreach (var conditions in Common.Logic.CurrentLogic.Conditions)
-                {
-                    if(conditions["Type"]=="2"){
-                        if(logic.LogicId.ToString()==conditions["Condition_LogicId"]){
-                            if (conditions["IsValid"]== "1")
-                            {
-                                openRowLayout.BackgroundColor = 0xfffe5e00;
-                                disableRowLayout.BackgroundColor = 0x00000000;
-                            }
-                            else if(conditions["IsValid"] == "0")
-                            {
-                                openRowLayout.BackgroundColor = 0x00000000;
-                                disableRowLayout.BackgroundColor = 0xfffe5e00;
-                            }
-                            break;
-                        }
-
-                    }
-
-                }
-
-            };
-
-           
-
-            var btncomplete = new Button
-            {
-                Y = middle.Bottom,
-                Height = Application.GetRealHeight(174),
-                TextID = MyInternationalizationString.complete,
-                TextSize = 16,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-            };
-            AddChidren (btncomplete);
-
-            if (logicConditionsInfo.ContainsKey("Type"))
-            {
-                logicConditionsInfo.Remove("Type");
-            }
-            if (logicConditionsInfo.ContainsKey("Condition_LogicId"))
-            {
-                logicConditionsInfo.Remove("Condition_LogicId");
-            }
-            logicConditionsInfo.Add("Type","2");
-            logicConditionsInfo.Add("Condition_LogicId",logic.LogicId.ToString());
-
-            btncomplete.MouseUpEventHandler += (sedder, e) => {
-                if (IsselectedLogic != null)
-                {
-                    LogicIfon.AddLogicconditions(logic,logicConditionsInfo);
-                }
-                else
-                {
-                    if (!IsDeviceEditor)
-                    {
-                        var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt),
-                                              Language.StringByID(MyInternationalizationString.selectlogiccondition),
-                                               Language.StringByID(MyInternationalizationString.complete)); alert.Show();
-                        return;
-                    }
-                    IsDeviceEditor = false;
-                }
-                var logicCommunalPage = new LogicCommunalPage ();
-                UserView.HomePage.Instance.AddChidren (logicCommunalPage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                logicCommunalPage.Show (() => { });
-                //var selectedLogic = new SelectedLogic ();
-                //MainPage.MainFrameLayout.AddChidren (selectedLogic);
-                //selectedLogic.Show (gateWay, logic);
-            };
-        }
-    }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
index 85f556e..c2fa1b9 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Send.cs
@@ -12,7 +12,7 @@
 {
     public class Send
     {
-        #region  ----鑾峰彇Logic
+        #region  ----Logic鎵�鏈夊彂閫佸懡浠�
         /// <summary>
         /// 鑾峰彇LogicId鐨勬柟娉�
         /// </summary>
@@ -388,7 +388,7 @@
                                     ["Type"] = int.Parse(dictionary["Type"]),
                                     ["IsValid"] = int.Parse(dictionary["IsValid"]),
                                     ["AtHome"] = int.Parse(dictionary["AtHome"]),
-                                    ["WhoSiteUId"] =dictionary["WhoSiteUId"],
+                                    ["WhoSiteUId"] = dictionary["WhoSiteUId"],
                                 };
                                 conditions.Add(diliInfo);
                                 break;
@@ -479,7 +479,6 @@
                                         {
                                             ["Type"] = int.Parse(dictionary["Type"]),
                                             ["Account"] = dictionary["Account"],
-                                            ["AccountName"] = dictionary["AccountName"],
                                             ["UserId"] = dictionary["UserId"],
 
                                         };
@@ -626,7 +625,7 @@
                         logic.LogicName = Logicifon["LogicName"].ToString();
                         logic.LogicType = int.Parse(Logicifon["LogicType"].ToString());
                         logic.Relationship = int.Parse(Logicifon["Relationship"].ToString());
-                        logic.LogicCustomPushText =Logicifon["LogicCustomPushText"].ToString();
+                        logic.LogicCustomPushText = Logicifon["LogicCustomPushText"].ToString();
                         logic.LogicIsCustomPushText = int.Parse(Logicifon["LogicIsCustomPushText"].ToString());
                         logic.TimeAttribute = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.TimeAttributeObj>(Logicifon["TimeAttribute"].ToString());
                         logic.Conditions = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(Logicifon["Conditions"].ToString());
@@ -714,47 +713,7 @@
                 return listLogic;
             });
         }
-        // <summary>
-        /// 閫氳繃璁惧鎵惧埌鍖哄煙(鎴块棿)鍚嶇О
-        /// </summary>
-        /// <param name="btnregionname">Btnregionname.</param>
-        /// <param name="device">Device.</param>
-        public static void RoomNmae(Button btnregionname, CommonDevice device)
-        {
-            var room = new Common.Room();
-            btnregionname.Text = room.GetRoomNameByDevice(device);
-        }
-        /// <summary>
-        /// 鎵惧嚭妤煎眰鎵�鏈夋埧闂�
-        /// </summary>
-        /// <param name="floorId">妤煎眰ID</param>
-        /// <returns></returns>
-        public static List<Common.Room> GetRoomList(string floorId)
-        {
-            return Common.Room.Lists.FindAll((obj) => obj.FloorId == floorId);
-            //var list1 = new List<Common.Room>();
-            /////鎵惧埌鏌愭ゼ灞傛埧闂村垪琛紱
-            //var list = Common.Room.Lists.FindAll((obj) => obj.FloorId == floorId);
-            //for (int i = 0; i < list.Count; i++)
-            //{
-            //    if (str == "device")
-            //    {
-            //        if (list[i].DeviceUIList.Count != 0)
-            //        {   ///杩囨护鎺夋病鏈夎澶囩殑鎴块棿
-            //            list1.Add(list[i]);
-            //        }
-            //    }
-            //    else
-            //    {
-            //        if (list[i].SceneUIList.Count != 0)
-            //        {   ///杩囨护鎺夋病鏈夊満鏅殑鎴块棿
-            //            list1.Add(list[i]);
-            //        }
-            //    }
-            //}
-            /////杩斿洖鎴块棿鍒楄〃锛�
-            //return list1;
-        }
+
         /// <summary>
         /// 鑾峰彇鍦烘櫙淇℃伅鐨勬柟娉�
         /// </summary>
@@ -779,7 +738,7 @@
                         sceneui = new SceneUI();
                         sceneui.Name = jObjectdata["Data"]["ScenesName"].ToString();
                         sceneui.Id = int.Parse(jObjectdata["Data"]["ScenesId"].ToString());
-                        
+
                     }
                 };
                 var mainGateWay = ZbGateway.MainGateWay;
@@ -798,7 +757,7 @@
                 while ((DateTime.Now - dateTime).TotalMilliseconds < 3 * 1000)
                 {
                     await System.Threading.Tasks.Task.Delay(100);
-                    if (sceneui!=null)
+                    if (sceneui != null)
                     {
                         break;
                     }
@@ -810,7 +769,7 @@
         #endregion
 
         #region  ----鑾峰彇闂ㄩ攣
-
+
         /// <summary>
         /// 鑾峰彇鑷繁+鍏朵粬鎴愬憳淇℃伅
         /// </summary>
@@ -861,7 +820,13 @@
             if (UserCenter.UserCenterResourse.UserInfo.AuthorityNo != 3)
             {
                 var pra = new UserCenter.MemberListInfoPra();
-                string result = await UserCenter.UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
+                string result = "";
+                if (AllUserIfon.Count != 0)
+                {
+                    //鏈嶅姟杩斿洖鏉ユ病鏈夐棬閿佹垚鍛樹俊鎭紝娌℃湁蹇呰鍐嶅幓璇锋眰鎴愬憳鍒楄〃锛�
+                    //鍘熷洜锛氳妭绾︽椂闂达紝浣撻獙鏁堟灉濂斤紱
+                    result = await UserCenter.UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
+                }
                 var listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UserCenter.MemberInfoRes>>(result);
                 for (int i = 0; i < listInfo.Count; i++)
                 {
@@ -926,7 +891,6 @@
         {
             var list = new List<User>();
             var s = await ReadUserList(doorlockMac);
-            //var s = await Data("璇诲彇浜戠闂ㄩ攣鏁版嵁", "/DoorLock/GetDoorLockPager", "POST", doorlockMac);
             var jObject = JObject.Parse(s);
             if (jObject == null || jObject["StateCode"].ToString() != "Success")
             {
@@ -953,7 +917,7 @@
         {
             string s = null;
             var str = await WebClientAsync(0, CommonPage.RequestHttpsHost + "/App/GetHomePager");//涓嶅悓鍖哄煙鍩熷悕鍓嶇紑涓嶄竴鏍�
-           // var str = await WebClientAsync(0, "https://global.hdlcontrol.com/HangZhouHdlCloudApi/App/GetHomePager");
+                                                                                                 // var str = await WebClientAsync(0, "https://global.hdlcontrol.com/HangZhouHdlCloudApi/App/GetHomePager");
             var jObject = JObject.Parse(str);
             if (jObject == null || jObject["StateCode"].ToString() != "Success")
             {
@@ -1017,7 +981,7 @@
             lockifon.doorlockmac = residential.doorlockmac;
             return await WebClientAsync(2, lockifon.Url, lockifon);
         }
-        #region 瀹氫箟瑙f瀽闂ㄩ攣鐨勫璞�
+      
         public class Residential
         {
             /// <summary>
@@ -1111,6 +1075,7 @@
             public bool IsFreezeUser;
 
         }
+
         /// <summary>
         /// 闂ㄩ攣鍒楄〃
         /// </summary>
@@ -1124,11 +1089,12 @@
         /// </summary>
         public static UserCenter.MemberInfoRes UserMemberInfoRes = null;
         #endregion
-        #endregion
 
         /// <summary>
-        ///  鑷繁鐢�
+        /// 鑷繁鐢ㄧ殑鍙戦�佺殑鏂规硶
         /// </summary>
+        /// <param name="tag">鏍囪鏄偅鏉″懡浠�</param>
+        /// <param name="logic">閫昏緫瀵硅薄</param>
         public static void Zj(bool tag, Common.Logic logic)
         {
             new System.Threading.Thread(() =>
@@ -1150,6 +1116,7 @@
             })
             { IsBackground = true }.Start();
         }
+
         #region  璇锋眰鏈嶅姟鍣ㄦ柟娉�---
         /// <summary>
         /// 璇锋眰鏁版嵁鐨勫皝瑁呮柟娉�
@@ -1195,15 +1162,6 @@
                         jObject.Add("LogicID", Common.Logic.CurrentLogic.LogicId);
                     }
                     break;
-                case "璇诲彇浜戠闂ㄩ攣鏁版嵁":
-                    {
-                        jObject.Add("RequestVersion", CommonPage.RequestVersion);
-                        jObject.Add("HomeId", Config.Instance.HomeId);
-                        jObject.Add("DoorLockId", obj.ToString());//闂ㄩ攣Mac+绔彛
-                        jObject.Add("PageSetting.PageSize", Int32.MaxValue.ToString());
-                    }
-                    break;
-
             }
             return await HttpWebRequest(getUrl, jObject.ToString(), method);
         }
@@ -1215,7 +1173,7 @@
         /// <param name="method">璇锋眰鏂瑰紡涓篜OST/GET</param>
         /// <param name="second">瓒呮椂鏃堕棿</param>
         /// <returns></returns>
-        public static async System.Threading.Tasks.Task<string>HttpWebRequest(string getUrl, string str, string method,int second= 3)
+        public static async System.Threading.Tasks.Task<string> HttpWebRequest(string getUrl, string str, string method, int second = 3)
         {
             HttpWebRequest request = WebRequest.Create(getUrl) as HttpWebRequest; //鍒涘缓璇锋眰
             request.Method = method; //璇锋眰鏂瑰紡涓篜OST/GET
@@ -1268,7 +1226,6 @@
                         postValues.Add("LoginAccessToken", Config.Instance.Token);
                         postValues.Add("MainAccountId", residential.MainUserDistributedMark);
                         postValues.Add("SharedHid", residential.Id);
-
                     }
                     break;
                 case 2:
@@ -1324,5 +1281,22 @@
             return System.Text.Encoding.UTF8.GetString(varByte);
         }
         #endregion
+
+        /// <summary>
+        /// 鍒ゆ柇瀛楀吀鏄惁瀛樺湪鐨勬柟娉�
+        /// </summary>
+        /// <param name="deviceConditionsInfo"></param>
+        /// <param name="Key"></param>
+        /// <param name="Value"></param>
+        public static void dictionary(Dictionary<string, string> deviceConditionsInfo, string Key, string Value)
+        {
+            if (deviceConditionsInfo.ContainsKey(Key))
+            {
+                deviceConditionsInfo.Remove(Key);
+            }
+            deviceConditionsInfo.Add(Key, Value);
+        }
+
+
     }
 }
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TemplateDeviceAction.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TemplateDeviceAction.cs
deleted file mode 100644
index 0552373..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/TemplateDeviceAction.cs
+++ /dev/null
@@ -1,2167 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Newtonsoft.Json.Linq;
-using Shared;
-using Shared.Common;
-using Shared.Phone;
-using Shared.R;
-using ZigBee.Device;
-namespace Shared.Phone.Device.Logic
-{
-    public class TemplateDeviceAction:FrameLayout
-    {
-        public TemplateDeviceAction()
-        {
-            Tag = "Logic";
-        }
-        Button roombjButton = new Button();
-        Button roomTextButton = new Button();
-        Button devicetypeButton = new Button();
-        VerticalScrolViewLayout middle;
-        FrameLayout clickframeLayout = new FrameLayout();
-        Button clickbutton = new Button();
-        Button clicktextcolcrbutton = new Button();
-        
-        public void Show()
-        {
-
-            UserView.HomePage.Instance.ScrollEnabled = false;
-            this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(160),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.devicestate,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var foolrname = new Button
-            {
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterRight,
-                X = Application.GetRealWidth(1080 - 400 - 120),
-                Width = Application.GetRealWidth(400),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                //TextID = MyInternationalizationString.customroom,
-                Text = Config.Instance.Home.GetCurrentFloorName,
-                TextSize = 14,
-            };
-            topRowLayout.AddChidren(foolrname);
-            var dropdown = new Button
-            {
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterRight,
-                X = foolrname.Right,
-                Width = Application.GetRealWidth(72),
-                Height = Application.GetRealHeight(72),
-                Y = Application.GetRealHeight(92),
-                UnSelectedImagePath = "ZigeeLogic/drop-down.png",
-            };
-            topRowLayout.AddChidren(dropdown);
-            #endregion
-
-
-            ///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱
-            if (Common.Room.Lists.Count == 0)
-            {
-                return;
-            }
-            ///鎴块棿婊戝姩鎺т欢
-            var roomhorizontalScrol = new HorizontalScrolViewLayout()
-            {
-                Width = Application.GetRealWidth(1080 - 58),
-                Height = Application.GetRealHeight(200),
-                Y = topRowLayout.Bottom,
-                X = Application.GetRealWidth(58),
-            };
-            this.AddChidren(roomhorizontalScrol);
-
-
-            ///璁惧绫诲瀷婊戝姩鎺т欢
-            var devicetypehorizontalScrol = new HorizontalScrolViewLayout()
-            {
-                Width = Application.GetRealWidth(1080 - 58),
-                Height = Application.GetRealHeight(280),
-                Y = roomhorizontalScrol.Bottom,
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                X = Application.GetRealWidth(58),
-                //Radius = (uint)Application.GetRealHeight(50),
-
-            };
-            this.AddChidren(devicetypehorizontalScrol);
-            devicetypehorizontalScrol.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
-
-            middle = new VerticalScrolViewLayout();
-            middle.Y = devicetypehorizontalScrol.Bottom + Application.GetRealHeight(40);
-            middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-            middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
-            middle.X = Application.GetRealWidth(58);
-            //middle.Radius = (uint)Application.GetRealHeight(50);
-            this.AddChidren(middle);
-            middle.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
-
-            ///鐩墠鏀寔鐨勮澶�
-            List<DeviceType> deviceTypeList = new List<DeviceType> {
-                DeviceType.OnOffOutput,
-                //DeviceType.DimmableLight,
-                //DeviceType.WindowCoveringDevice,
-                //DeviceType.Thermostat,
-                //DeviceType.AirSwitch,
-            };
-
-
-            ///妤煎眰鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> foorlclick = (sender, e) =>
-            {
-
-                var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                this.AddChidren(flMain);
-                flMain.MouseUpEventHandler += (sender2, e2) =>
-                {
-                    flMain.RemoveFromParent();
-                };
-                var foolrbjicon = new FrameLayout
-                {
-
-                    Width = Application.GetRealWidth(450),
-                    Height = Application.GetRealHeight(780),
-                    X = Application.GetRealWidth(1080 - 468 - 35),
-                    Y = Application.GetRealHeight(184),
-                    BackgroundImagePath = "Item/SelectFloor_Right.png",
-                };
-                flMain.AddChidren(foolrbjicon);
-
-                var btnfoolrtext = new Button
-                {
-                    Width = Application.GetRealWidth(450),
-                    Height = Application.GetRealHeight(150),
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    X = Application.GetRealWidth(80),
-                    TextID = MyInternationalizationString.selecfoolr,
-                    TextSize = 14,
-                };
-                foolrbjicon.AddChidren(btnfoolrtext);
-
-                var foolrbj = new VerticalScrolViewLayout
-                {
-
-                    Width = Application.GetRealWidth(450),
-                    Height = foolrbjicon.Height - btnfoolrtext.Height,
-                    X = Application.GetRealWidth(80),
-                    Y = btnfoolrtext.Bottom,
-                };
-                foolrbjicon.AddChidren(foolrbj);
-
-                foreach (var foolr in Config.Instance.Home.FloorDics)
-                {
-                    var foolrRowLayout = new RowLayout
-                    {
-                        Height = Application.GetRealHeight(150),
-                        LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-                    };
-                    foolrbj.AddChidren(foolrRowLayout);
-
-                    var btnfoolricon = new Button
-                    {
-                        Width = Application.GetRealWidth(81),
-                        Height = Application.GetRealHeight(81),
-                        UnSelectedImagePath = "Floor/Floor.png",
-                        Gravity = Gravity.CenterVertical,
-                    };
-                    foolrRowLayout.AddChidren(btnfoolricon);
-
-
-                    var btnfoolrname = new Button
-                    {
-                        Width = Application.GetRealWidth(250),
-                        Height = Application.GetRealHeight(150),
-                        Text = foolr.Value,
-                        TextAlignment = TextAlignment.CenterLeft,
-                        TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                        Tag = foolr.Key,
-                        X = btnfoolricon.Right + Application.GetRealWidth(12),
-                        TextSize = 14,
-                    };
-                    foolrRowLayout.AddChidren(btnfoolrname);
-                    if (foolrname.Text == foolr.Value)
-                    {
-                        btnfoolricon.UnSelectedImagePath = "Floor/FloorSelected.png";
-                        btnfoolrname.TextColor = ZigbeeColor.Current.LogicTextBlackColor;
-                    }
-
-                    EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) =>
-                    {
-                        roomhorizontalScrol.RemoveAll();
-                        devicetypehorizontalScrol.RemoveAll();
-                        middle.RemoveAll();
-                        foolrname.Text = btnfoolrname.Text;
-                        flMain.RemoveFromParent();
-                        var list = Send.GetRoomList(btnfoolrname.Tag.ToString());
-                        AllRoomView(list, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
-
-                    };
-                    foolrRowLayout.MouseUpEventHandler += foolrnameclick;
-                    btnfoolrname.MouseUpEventHandler += foolrnameclick;
-
-
-                }
-
-            };
-            foolrname.MouseUpEventHandler += foorlclick;
-            dropdown.MouseUpEventHandler += foorlclick;
-
-            ///绗竴娆¤繘鏉�
-            var roomlists = new List<Common.Room>();
-            roomlists.Clear();
-            if (Config.Instance.Home.FloorDics.Count < 2)
-            {
-                foolrname.Visible = false;
-                dropdown.Visible = false;
-                if (Config.Instance.Home.FloorDics.Count == 0)
-                {
-                    roomlists.AddRange(Common.Room.Lists);
-                }
-                else
-                {
-                    roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
-                }
-            }
-            else
-            {
-                roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
-
-            }
-            AllRoomView(roomlists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
-        }
-        /// <summary>
-        /// 鍔犺浇鎵�鏈夋埧闂寸殑瑙嗗浘鏂规硶
-        /// </summary>
-        void AllRoomView(List<Common.Room> roomlist, List<DeviceType> deviceTypeList, HorizontalScrolViewLayout roomhorizontalScrol, HorizontalScrolViewLayout devicetypehorizontalScrol)
-        {
-            for (int i = 0; i < roomlist.Count; i++)
-            {
-                var room = roomlist[i];
-                var fra = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(200),
-                    Width = Application.GetRealWidth(255),
-                };
-                roomhorizontalScrol.AddChidren(fra);
-
-                var roombjBtn = new Button
-                {
-                    Height = Application.GetRealHeight(158),
-                    Width = Application.GetRealWidth(255),
-                    UnSelectedImagePath = "ZigeeLogic/iconBackgroundColor.png",
-                    SelectedImagePath = "ZigeeLogic/iconSelectedBackgroundColor.png",
-                    Y = Application.GetRealHeight(21),
-                };
-                fra.AddChidren(roombjBtn);
-
-                var roomnameBtn = new Button
-                {
-
-                    Height = Application.GetRealHeight(152 - 26 - 20),
-                    Width = Application.GetRealWidth(255 - 20 - 50),
-                    Text = room.Name,
-                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                    SelectedTextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    Y = Application.GetRealHeight(21 + 13 + 10),
-                    X = Application.GetRealWidth(10 + 25),
-
-                };
-                fra.AddChidren(roomnameBtn);
-                if (i == 0)
-                {
-                    roombjButton.IsSelected = false;
-                    roombjButton = roombjBtn;
-                    roombjBtn.IsSelected = true;
-
-                    roomTextButton.IsSelected = false;
-                    roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
-                    var list = new List<DeviceUI>();
-                    foreach (var device in room.DeviceUIList)
-                    {
-                        if (device.CommonDevice == null)
-                        {
-                            continue;
-                        }
-                        if (!deviceTypeList.Contains(device.CommonDevice.Type))
-                        {
-                            continue;
-                        }
-                        list.Add(device);
-                    }
-                    if (list.Count == 0)
-                    {
-                        devicetypehorizontalScrol.Height = 0;
-                      
-                        middle.Height = 0;
-                    }
-                    else
-                    {
-                        devicetypehorizontalScrol.Height = Application.GetRealHeight(280);
-                        
-                        middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-                    }
-                    AllDeviceTypeView(list, devicetypehorizontalScrol);
-
-                }
-
-
-                EventHandler<MouseEventArgs> roomclick = (sender, e) =>
-                {
-                    roombjButton.IsSelected = false;
-                    roombjButton = roombjBtn;
-                    roombjBtn.IsSelected = true;
-
-                    roomTextButton.IsSelected = false;
-                    roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
-                    var list = new List<DeviceUI>();
-                    foreach (var device in room.DeviceUIList)
-                    {
-                        if (device.CommonDevice == null)
-                        {
-                            continue;
-                        }
-                        if (!deviceTypeList.Contains(device.CommonDevice.Type))
-                        {
-                            continue;
-                        }
-                        list.Add(device);
-                    }
-                    if (list.Count == 0)
-                    {
-                        devicetypehorizontalScrol.Height = 0;
-                      
-                        middle.Height = 0;
-                    }
-                    else
-                    {
-                        devicetypehorizontalScrol.Height = Application.GetRealHeight(280);
-                      
-                        middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-                    }
-                    AllDeviceTypeView(list, devicetypehorizontalScrol);
-
-
-                };
-                roomnameBtn.MouseUpEventHandler += roomclick;
-                roombjBtn.MouseUpEventHandler += roomclick;
-
-            }
-        }
-
-        /// <summary>
-        ///鍔犺浇璇ュ尯鍩熸墍鏈夎澶囩殑瑙嗗浘鏂规硶
-        /// </summary>
-        void AllDeviceTypeView(List<DeviceUI> devicelist, HorizontalScrolViewLayout devicetypehorizontalScrol)
-        {
-
-            List<string> devicetypelist = new List<string>();
-            devicetypelist.Clear();
-
-            #region  ------鎺掑垪璁惧绫诲瀷------
-            var lightjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.DimmableLight || device.CommonDevice.Type == DeviceType.OnOffOutput);
-            if (lightjosn != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Lights));
-            }
-            var curtainjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.WindowCoveringDevice);
-            if (curtainjosn != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains));
-            }
-            var ac = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.Thermostat);
-            if (ac != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.AC));
-            }
-            var airSwitch = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.AirSwitch);
-            if (airSwitch != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Airswitch));
-            }
-
-            #endregion
-
-            devicetypehorizontalScrol.RemoveAll();
-            for (int i = 0; i < devicetypelist.Count; i++)
-            {
-
-                var devicetype = devicetypelist[i];
-
-                var spaceRowLayout = new FrameLayout();
-                devicetypehorizontalScrol.AddChidren(spaceRowLayout);
-                if (i == 0)
-                {
-                    spaceRowLayout.Width = Application.GetRealWidth(37);
-                }
-                else
-                {
-                    spaceRowLayout.Width = Application.GetRealWidth(80);
-                }
-
-                var deviceRowLayout = new FrameLayout
-                {
-                    Width = Application.GetRealWidth(156 + 20),
-                    Height = Application.GetRealHeight(280 - 30),
-                    Y = Application.GetRealHeight(30),
-                };
-                devicetypehorizontalScrol.AddChidren(deviceRowLayout);
-
-                var backgroundColor = new Button
-                {
-                    Width = Application.GetRealWidth(156),
-                    Height = Application.GetRealHeight(180),
-                    X = Application.GetRealWidth(10),
-                    UnSelectedImagePath = "ZigeeLogic/deviceunselectedbackgroundcolor.png",
-                    SelectedImagePath = "ZigeeLogic/deviceselectedbackgroundcolor.png",
-                };
-                deviceRowLayout.AddChidren(backgroundColor);
-
-
-                var devicetypeicon = new Button
-                {
-                    Width = Application.GetRealWidth(84),
-                    Height = Application.GetRealHeight(84),
-                    X = Application.GetRealWidth(46),
-                    Y = Application.GetRealHeight(30),
-                };
-                deviceRowLayout.AddChidren(devicetypeicon);
-
-                var devicetypename = new Button
-                {
-                    Width = Application.GetRealWidth(176),
-                    Height = Application.GetRealHeight(40),
-                    Text = devicetype,
-                    TextAlignment = TextAlignment.Center,
-                    Y = backgroundColor.Bottom,
-                    TextColor = ZigbeeColor.Current.LogicAddColor,
-                    TextSize = 10,
-                };
-                deviceRowLayout.AddChidren(devicetypename);
-                if (devicetype == Language.StringByID(MyInternationalizationString.Lights))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedlight.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.Curtains))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedcurtain.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.AC))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedac.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.Airswitch))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedairswitch.png";
-                }
-                EventHandler<MouseEventArgs> devicetypeclick = (sender13, e13) =>
-                {
-
-                    devicetypeButton.IsSelected = false;
-                    devicetypeButton = backgroundColor;
-                    backgroundColor.IsSelected = true;
-                    List<DeviceType> list = new List<DeviceType>();
-                    list.Clear();
-                    ///鍒嗙被鏄剧ず锛堜緥濡傜伅鍏夛細{鐏厜1锛岀伅鍏�2...}锛�
-                    if (devicetype == Language.StringByID(MyInternationalizationString.Lights))
-                    {
-                        list.Add(DeviceType.OnOffOutput);//0x0101鍗佽繘鍒�257
-                        list.Add(DeviceType.DimmableLight);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.Curtains))
-                    {
-                        list.Add(DeviceType.WindowCoveringDevice);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.AC))
-                    {
-                        list.Add(DeviceType.Thermostat);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.Airswitch))
-                    {
-                        list.Add(DeviceType.AirSwitch);
-                    }
-
-                    ActionDeviceView(list, devicelist);
-
-                };
-                deviceRowLayout.MouseUpEventHandler += devicetypeclick;
-                devicetypename.MouseUpEventHandler += devicetypeclick;
-                devicetypeicon.MouseUpEventHandler += devicetypeclick;
-                backgroundColor.MouseUpEventHandler += devicetypeclick;
-
-            }
-            ///鏄剧ず鎴块棿鎵�鏈夎澶�
-            ActionDeviceView(new List<DeviceType>(), devicelist);
-        }
-        /// <summary>
-        /// 鍔犺浇璇ョ被鍨嬭澶囪鍥炬柟娉�
-        /// </summary>
-        /// <param name="devicelist">璁惧鍒楄〃</param>
-        void ActionDeviceView(List<DeviceType> deviceTypelist, List<DeviceUI> devicelist)
-        {
-            middle.RemoveAll();
-            foreach (var common in devicelist)
-            {
-
-                if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.CommonDevice.Type))
-                {
-                    continue;
-                }
-
-                var deviceFramelayout = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(160),
-                };
-                middle.AddChidren(deviceFramelayout);
-
-                var bjFramelayout = new FrameLayout
-                {
-                    Width = Application.GetRealWidth(112),
-                    Height = Application.GetRealHeight(112),
-                    X = Application.GetRealWidth(58),
-                    Y = Application.GetRealHeight(30 + 9),
-                    Radius = (uint)Application.GetRealHeight(56),
-                    BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-                };
-                deviceFramelayout.AddChidren(bjFramelayout);
-
-                var deviceIconBtn = new Button
-                {
-                    Width = Application.GetRealWidth(82),
-                    Height = Application.GetRealHeight(82),
-                    Gravity = Gravity.Center,
-
-                };
-                bjFramelayout.AddChidren(deviceIconBtn);
-
-                var deviceRow = new RowLayout
-                {
-                    Y = Application.GetRealHeight(30),
-                    Width = Application.GetRealWidth(850),
-                    Height = Application.GetRealHeight(130),
-                    X = Application.GetRealWidth(176 + 10),
-                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-
-                };
-                deviceFramelayout.AddChidren(deviceRow);
-
-                var devicename = new Button
-                {
-                    Text = common.CommonDevice.DeviceEpointName,
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    SelectedTextColor = ZigbeeColor.Current.LogicAddColor,
-                    TextSize = 14,
-                };
-                deviceRow.AddChidren(devicename);
-                switch (common.CommonDevice.Type)
-                {
-
-                    case DeviceType.OnOffOutput:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/light.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedlight.png";
-                        }
-                        break;
-                    case DeviceType.DimmableLight:
-                        {
-
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/dimmableLight.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selecteddimmableLight.png";
-                        }
-                        break;
-                    case DeviceType.WindowCoveringDevice:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/curtain.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedcurtain.png";
-                        }
-                        break;
-                    case DeviceType.Thermostat:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/ac.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedac.png";
-                        }
-                        break;
-                    case DeviceType.AirSwitch:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/airswitch.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedairswitch.png";
-                        }
-                        break;
-                }
-
-                EventHandler<MouseEventArgs> devicclick = (sen, e) =>
-                {
-                    clickbutton.IsSelected = false;
-                    clickbutton = deviceIconBtn;
-                    deviceIconBtn.IsSelected = true;
-                    clickframeLayout.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-                    clickframeLayout = bjFramelayout;
-                    bjFramelayout.BackgroundColor = ZigbeeColor.Current.LogicIconBackgroundColor;
-                    clicktextcolcrbutton.IsSelected = false;
-                    clicktextcolcrbutton = devicename;
-                    devicename.IsSelected = true;
-
-                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                    this.AddChidren(flMain);
-                    CurrentDeviceStateView(flMain, common.CommonDevice, false);
-                };
-                deviceFramelayout.MouseUpEventHandler += devicclick;
-                bjFramelayout.MouseUpEventHandler += devicclick;
-                deviceIconBtn.MouseUpEventHandler += devicclick;
-                deviceRow.MouseUpEventHandler += devicclick;
-                devicename.MouseUpEventHandler += devicclick;
-
-            }
-        }
-        /// <summary>
-        /// 閫変腑璇ヨ澶囧姛鑳戒綔涓烘潯浠剁殑瑙嗗浘鏂规硶
-        /// </summary>
-        /// <param name="common">Common.</param>
-        public static void CurrentDeviceStateView(FrameLayout flMain, CommonDevice common, bool edit)
-        {
-            //涓嶈褰撳墠鐣岄潰婊戝姩
-            UserView.HomePage.Instance.ScrollEnabled = false;
-            Dictionary<string, object> actionsInfo = new Dictionary<string, object>();
-            List<Dictionary<string, string>> taskListInfo = new List<Dictionary<string, string>>();
-            //var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-            //this.AddChidren(flMain);
-            flMain.MouseUpEventHandler += (sender, e) =>
-            {
-                flMain.RemoveFromParent();
-            };
-
-            var devicefra = new FrameLayout
-            {
-
-                Width = Application.GetRealWidth(1080),
-                Height = Application.GetRealHeight(530 + 160),
-                Y = Application.GetRealHeight(1920 - 530 - 160),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-               // Radius = (uint)Application.GetRealHeight(60),
-            };
-            flMain.AddChidren(devicefra);
-            devicefra.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerTopRight);
-
-            #region  -------鍙栨秷   瀹屾垚
-            var timetype = new RowLayout
-            {
-                Height = Application.GetRealHeight(140),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            devicefra.AddChidren(timetype);
-            var Btncancel = new Button
-            {
-                TextID = MyInternationalizationString.cancel,
-                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                X = Application.GetRealWidth(80),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextSize = 14,
-            };
-            timetype.AddChidren(Btncancel);
-            Btncancel.MouseUpEventHandler += (sender16, e16) =>
-            {
-                flMain.RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var Btntitle = new Button
-            {
-                TextID = MyInternationalizationString.security,
-                TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(420),
-                TextAlignment = TextAlignment.Center,
-                X = Btncancel.Right + Application.GetRealWidth(50),
-                TextSize = 16,
-                Text = common.DeviceEpointName,
-            };
-            timetype.AddChidren(Btntitle);
-            var Btncomplete = new Button
-            {
-                TextID = MyInternationalizationString.complete,
-                TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                TextAlignment = TextAlignment.CenterRight,
-                X = Btntitle.Right + Application.GetRealWidth(50),
-                TextSize = 14,
-
-            };
-            timetype.AddChidren(Btncomplete);
-            #endregion
-
-
-            string SelectedDeviceStatusaction = "no";
-            actionsInfo.Add("LinkType", 0);
-            actionsInfo.Add("DeviceAddr", common.DeviceAddr);
-            actionsInfo.Add("Epoint", common.DeviceEpoint);
-            actionsInfo.Add("Time", 0);
-            actionsInfo.Add("TaskList", taskListInfo);
-
-            List<Dictionary<string, string>> TaskList = null;
-            if (edit)
-            {
-                foreach (var deviceinfo in Common.Logic.CurrentLogic.Actions)
-                {
-                    if (deviceinfo["LinkType"].ToString() == "0")
-                    {
-
-                        if (deviceinfo["DeviceAddr"].ToString() == common.DeviceAddr && deviceinfo["Epoint"].ToString() == common.DeviceEpoint.ToString())
-                        {
-                            TaskList = deviceinfo["TaskList"] as List<Dictionary<string, string>>;
-                            break;
-                        }
-                    }
-                }
-            }
-            switch (common.Type)
-            {
-
-                ///鐏厜
-                case DeviceType.OnOffOutput:
-                    {
-
-                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                        Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
-                        if (switchdictionary.ContainsKey("TaskType"))
-                        {
-                            switchdictionary.Remove("TaskType");
-                        }
-                        if (switchdictionary.ContainsKey("Data1"))
-                        {
-                            switchdictionary.Remove("Data1");
-                        }
-                        if (switchdictionary.ContainsKey("Data2"))
-                        {
-                            switchdictionary.Remove("Data2");
-                        }
-                        switchdictionary.Add("TaskType", "1");
-                        switchdictionary.Add("Data1", "0");
-                        switchdictionary.Add("Data2", "0");
-                        taskListInfo.Add(switchdictionary);
-
-                        #endregion
-
-                        #region  鐏厜View
-
-                        #region 寮�
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-                        #endregion
-                        #region  鍏�
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = openframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-                        #endregion
-                        #region   鍙栧弽
-                        var takebackframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = closeframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(takebackframelayout);
-                        var takebackrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        takebackframelayout.AddChidren(takebackrowlayout);
-
-                        var btntakeback = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.onoff,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        takebackrowlayout.AddChidren(btntakeback);
-
-                        var takebackBtnSelected = new SelectedButton();
-                        takebackrowlayout.AddChidren(takebackBtnSelected);
-
-                        #endregion
-
-
-                        #endregion
-
-                        ///纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            takebackBtnSelected.Visible = false;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("Data1", "1");//榛樿鍊�
-
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-                        ///鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-                            takebackBtnSelected.Visible = false;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("Data1", "0");//榛樿鍊�
-
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-                        //鍙栧弽
-                        EventHandler<MouseEventArgs> takebackclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = false;
-                            takebackBtnSelected.Visible = true;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("Data1", "2");//榛樿鍊�
-
-                        };
-                        takebackrowlayout.MouseUpEventHandler += takebackclick;
-                        btntakeback.MouseUpEventHandler += takebackclick;
-                        takebackBtnSelected.MouseUpEventHandler += takebackclick;
-                        takebackframelayout.MouseUpEventHandler += takebackclick;
-                        if (edit && TaskList != null)
-                        {
-                            foreach (var value in TaskList)
-                            {
-                                if (value["TaskType"] == "1")
-                                {
-                                    if (switchdictionary.ContainsKey("Data1"))
-                                    {
-                                        switchdictionary.Remove("Data1");
-                                    }
-                                    if (value["Data1"] == "1")
-                                    {
-                                        switchdictionary.Add("Data1", "1");
-                                        openBtnSelected.Visible = true;
-                                        closeBtnSelected.Visible = false;
-                                        takebackBtnSelected.Visible = false;
-                                    }
-                                    else if (value["Data1"] == "0")
-                                    {
-                                        switchdictionary.Add("Data1", "0");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = true;
-                                        takebackBtnSelected.Visible = false;
-                                    }
-                                    else if (value["Data1"] == "2")
-                                    {
-                                        switchdictionary.Add("Data1", "2");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = false;
-                                        takebackBtnSelected.Visible = true;
-                                    }
-                                    break;
-                                }
-
-                            }
-                        }
-
-                    }
-                    break;
-                ///璋冨厜鐏厜
-                case DeviceType.DimmableLight:
-                    {
-
-                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                        Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
-                        if (switchdictionary.ContainsKey("Data2"))
-                        {
-                            switchdictionary.Remove("Data2");
-                        }
-                        switchdictionary.Add("Data2", "0");
-                        taskListInfo.Add(switchdictionary);
-
-                        #endregion
-
-                        #region  鐏厜View
-
-                        devicefra.Y = Application.GetRealHeight(1920 - 160 * 3 - 210 - 160);
-                        devicefra.Height = Application.GetRealHeight(160 * 3 + 210 + 160);
-
-                        #region 寮�
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160 + 160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-
-                        var horizontalSeekBarRow = new RowLayout
-                        {
-                            Y = openrowlayout.Bottom,
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(160),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(horizontalSeekBarRow);
-                        var horizontalSeekBarVol = new HorizontalSeekBar
-                        {
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(80),
-                            Radius = (uint)Application.GetRealHeight(25),
-                            Y = Application.GetRealHeight(25),
-                            //Gravity = Gravity.CenterVertical,
-                            ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected,
-                            Max = 100,
-                            SleepTime = 1000,
-                            ThumbRadius = 9,
-                            IsCanMove = false
-                        };
-                        horizontalSeekBarRow.AddChidren(horizontalSeekBarVol);
-
-                        #endregion
-
-                        #region  鍏�
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = openframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-                        #endregion
-
-                        #region   鍙栧弽
-                        var takebackframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = closeframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(takebackframelayout);
-                        var takebackrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        takebackframelayout.AddChidren(takebackrowlayout);
-
-                        var btntakeback = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.onoff,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        takebackrowlayout.AddChidren(btntakeback);
-
-                        var takebackBtnSelected = new SelectedButton();
-                        takebackrowlayout.AddChidren(takebackBtnSelected);
-
-                        #endregion
-
-
-                        #endregion
-
-                        int Progressvalue = 100;
-                        horizontalSeekBarVol.ProgressChanged += (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            Progressvalue = horizontalSeekBarVol.Progress;
-                            if (switchdictionary.ContainsKey("TaskType"))
-                            {
-                                switchdictionary.Remove("TaskType");
-                            }
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("TaskType", "3");
-                            //鏈�澶т寒搴﹀�兼槸254闇�瑕佽浆鎹紱
-                            var lightbrightnessvalue = (254 * horizontalSeekBarVol.Progress) / 100;
-                            switchdictionary.Add("Data1", lightbrightnessvalue.ToString());
-
-                        };
-                        ///纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsCanMove = true;
-                            horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected;
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            takebackBtnSelected.Visible = false;
-                            horizontalSeekBarVol.Progress = Progressvalue;
-                            if (switchdictionary.ContainsKey("TaskType"))
-                            {
-                                switchdictionary.Remove("TaskType");
-                            }
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("TaskType", "3");
-                            //鏈�澶т寒搴﹀�兼槸254闇�瑕佽浆鎹紱
-                            var lightbrightnessvalue = (254 * horizontalSeekBarVol.Progress) / 100;
-                            switchdictionary.Add("Data1", lightbrightnessvalue.ToString());
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-                        ///鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsCanMove = false;
-                            horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor;
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-                            takebackBtnSelected.Visible = false;
-                            if (switchdictionary.ContainsKey("TaskType"))
-                            {
-                                switchdictionary.Remove("TaskType");
-                            }
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("TaskType", "1");
-                            switchdictionary.Add("Data1", "0");//榛樿鍊�
-
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-                        //鍙栧弽
-                        EventHandler<MouseEventArgs> takebackclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsCanMove = false;
-                            horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor;
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = false;
-                            takebackBtnSelected.Visible = true;
-                            if (switchdictionary.ContainsKey("TaskType"))
-                            {
-                                switchdictionary.Remove("TaskType");
-                            }
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            switchdictionary.Add("TaskType", "1");
-                            switchdictionary.Add("Data1", "2");//榛樿鍊�
-
-                        };
-                        takebackrowlayout.MouseUpEventHandler += takebackclick;
-                        btntakeback.MouseUpEventHandler += takebackclick;
-                        takebackBtnSelected.MouseUpEventHandler += takebackclick;
-                        takebackframelayout.MouseUpEventHandler += takebackclick;
-
-                        if (edit && TaskList != null)
-                        {
-                            foreach (var value in TaskList)
-                            {
-                                if (switchdictionary.ContainsKey("Data1"))
-                                {
-                                    switchdictionary.Remove("Data1");
-                                }
-                                if (switchdictionary.ContainsKey("TaskType"))
-                                {
-                                    switchdictionary.Remove("TaskType");
-                                }
-                                if (value["TaskType"] == "1")
-                                {
-                                    switchdictionary.Add("TaskType", "1");
-                                    if (value["Data1"] == "0")
-                                    {
-                                        switchdictionary.Add("Data1", "0");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = true;
-                                        takebackBtnSelected.Visible = false;
-                                        horizontalSeekBarVol.IsCanMove = false;
-                                        horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor;
-                                    }
-                                    else if (value["Data1"] == "2")
-                                    {
-                                        switchdictionary.Add("Data1", "2");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = false;
-                                        takebackBtnSelected.Visible = true;
-                                        horizontalSeekBarVol.IsCanMove = false;
-                                        horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor;
-                                    }
-
-                                }
-                                else if (value["TaskType"] == "3")
-                                {
-                                    switchdictionary.Add("TaskType", "3");
-                                    switchdictionary.Add("Data1", value["Data1"]);
-                                    openBtnSelected.Visible = true;
-                                    closeBtnSelected.Visible = false;
-                                    takebackBtnSelected.Visible = false;
-                                    horizontalSeekBarVol.IsCanMove = true;
-                                    horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected;
-                                    horizontalSeekBarVol.Progress = int.Parse(value["Data1"]) * 100 / 254;
-                                    Progressvalue = horizontalSeekBarVol.Progress;
-
-                                }
-                                break;
-
-                            }
-                        }
-
-                    }
-                    break;
-                ///绐楀笜
-                case DeviceType.WindowCoveringDevice:
-                    {
-                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                        Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
-                        if (switchdictionary.ContainsKey("TaskType"))
-                        {
-                            switchdictionary.Remove("TaskType");
-                        }
-                        switchdictionary.Add("TaskType", "6");
-
-                        taskListInfo.Add(switchdictionary);
-
-                        #endregion
-                        devicefra.Y = Application.GetRealHeight(1920 - 160 * 2 - 210 - 160);
-                        devicefra.Height = Application.GetRealHeight(160 * 2 + 210 + 160);
-                        #region 绐楀笜View
-
-                        #region 寮�
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160 + 160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-
-
-                        var horizontalSeekBarRow = new RowLayout
-                        {
-                            Y = openrowlayout.Bottom,
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(160),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(horizontalSeekBarRow);
-                        var horizontalSeekBarVol = new HorizontalSeekBar
-                        {
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(80),
-                            Radius = (uint)Application.GetRealHeight(25),
-                            Y = Application.GetRealHeight(25),
-                            //Gravity = Gravity.CenterVertical,
-                            ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected,
-                            Max = 100,
-                            SleepTime = 1000,
-                            ThumbRadius = 9,
-                            IsCanMove = false
-                        };
-                        horizontalSeekBarRow.AddChidren(horizontalSeekBarVol);
-
-                        #endregion
-
-                        #region  鍏�
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = openframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-                        #endregion
-
-
-
-                        #endregion
-                        int Progressvalue = 100;
-                        horizontalSeekBarVol.ProgressChanged += (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            Progressvalue = horizontalSeekBarVol.Progress;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            if (switchdictionary.ContainsKey("Data2"))
-                            {
-                                switchdictionary.Remove("Data2");
-                            }
-                            switchdictionary.Add("Data1", "5");
-                            switchdictionary.Add("Data2", horizontalSeekBarVol.Progress.ToString());
-
-                        };
-                        ///纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsCanMove = true;
-                            horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected;
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            horizontalSeekBarVol.Progress = Progressvalue;
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            if (switchdictionary.ContainsKey("Data2"))
-                            {
-                                switchdictionary.Remove("Data2");
-                            }
-                            switchdictionary.Add("Data1", "5");
-                            switchdictionary.Add("Data2", horizontalSeekBarVol.Progress.ToString());
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-                        ///鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatusaction = "yes";
-                            horizontalSeekBarVol.IsCanMove = false;
-                            horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor;
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            if (switchdictionary.ContainsKey("Data2"))
-                            {
-                                switchdictionary.Remove("Data2");
-                            }
-                            switchdictionary.Add("Data2", "0");
-                            switchdictionary.Add("Data1", "1");//榛樿鍊�
-
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-
-
-
-                        if (edit && TaskList != null)
-                        {
-                            foreach (var value in TaskList)
-                            {
-                                if (value["TaskType"] == "6")
-                                {
-                                    if (value["Data1"] == "5")
-                                    {
-                                        if (switchdictionary.ContainsKey("Data1"))
-                                        {
-                                            switchdictionary.Remove("Data1");
-                                        }
-                                        if (switchdictionary.ContainsKey("Data2"))
-                                        {
-                                            switchdictionary.Remove("Data2");
-                                        }
-                                        switchdictionary.Add("Data1", "5");
-                                        switchdictionary.Add("Data2", value["Data2"]);
-                                        horizontalSeekBarVol.IsCanMove = true;
-                                        horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColorSelected;
-                                        openBtnSelected.Visible = true;
-                                        closeBtnSelected.Visible = false;
-                                        horizontalSeekBarVol.Progress = int.Parse(value["Data2"]);
-                                        Progressvalue = horizontalSeekBarVol.Progress;
-                                    }
-                                    else if (value["Data1"] == "1")
-                                    {
-                                        if (switchdictionary.ContainsKey("Data1"))
-                                        {
-                                            switchdictionary.Remove("Data1");
-                                        }
-                                        switchdictionary.Add("Data1", "1");
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = true;
-                                        horizontalSeekBarVol.IsCanMove = false;
-                                        horizontalSeekBarVol.ProgressColor = ZigbeeColor.Current.LogicProgressColor;
-                                    }
-
-                                }
-
-                            }
-                        }
-                    }
-                    break;
-                ///绌烘皵寮�鍏�
-                case DeviceType.AirSwitch:
-                    {
-                        {
-
-                            #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                            Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
-                            if (switchdictionary.ContainsKey("TaskType"))
-                            {
-                                switchdictionary.Remove("TaskType");
-                            }
-                            if (switchdictionary.ContainsKey("Data1"))
-                            {
-                                switchdictionary.Remove("Data1");
-                            }
-                            if (switchdictionary.ContainsKey("Data2"))
-                            {
-                                switchdictionary.Remove("Data2");
-                            }
-                            switchdictionary.Add("TaskType", "1");
-                            switchdictionary.Add("Data1", "0");
-                            switchdictionary.Add("Data2", "0");
-                            taskListInfo.Add(switchdictionary);
-
-                            #endregion
-
-                            #region  绌烘皵鐏厜View
-
-                            #region 寮�
-
-                            var openframelayout = new FrameLayout
-                            {
-                                Height = Application.GetRealHeight(160),
-                                Y = timetype.Bottom + Application.GetRealHeight(20),
-                            };
-                            devicefra.AddChidren(openframelayout);
-
-                            var openrowlayout = new RowLayout
-                            {
-                                Y = Application.GetRealHeight(30),
-                                Width = Application.GetRealWidth(920),
-                                Height = Application.GetRealHeight(130),
-                                X = Application.GetRealWidth(80),
-                                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                            };
-                            openframelayout.AddChidren(openrowlayout);
-
-                            var btnopen = new Button
-                            {
-                                Width = Application.GetRealWidth(600),
-                                TextID = MyInternationalizationString.open,
-                                TextAlignment = TextAlignment.CenterLeft,
-                                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                                TextSize = 14,
-                            };
-                            openrowlayout.AddChidren(btnopen);
-
-                            var openBtnSelected = new SelectedButton();
-                            openrowlayout.AddChidren(openBtnSelected);
-                            #endregion
-                            #region  鍏�
-                            var closeframelayout = new FrameLayout
-                            {
-                                Height = Application.GetRealHeight(160),
-                                Y = openframelayout.Bottom,
-                            };
-                            devicefra.AddChidren(closeframelayout);
-                            var closerowlayout = new RowLayout
-                            {
-                                Y = Application.GetRealHeight(30),
-                                Width = Application.GetRealWidth(920),
-                                Height = Application.GetRealHeight(130),
-                                X = Application.GetRealWidth(80),
-                                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                            };
-                            closeframelayout.AddChidren(closerowlayout);
-
-                            var btnclose = new Button
-                            {
-                                //Text = "鍏�",
-                                TextID = MyInternationalizationString.close,
-                                Width = Application.GetRealWidth(600),
-                                TextAlignment = TextAlignment.CenterLeft,
-                                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                                TextSize = 14,
-                            };
-                            closerowlayout.AddChidren(btnclose);
-
-                            var closeBtnSelected = new SelectedButton();
-                            closerowlayout.AddChidren(closeBtnSelected);
-                            #endregion
-                            #region   鍙栧弽
-                            var takebackframelayout = new FrameLayout
-                            {
-                                Height = Application.GetRealHeight(160),
-                                Y = closeframelayout.Bottom,
-                            };
-                            devicefra.AddChidren(takebackframelayout);
-                            var takebackrowlayout = new RowLayout
-                            {
-                                Y = Application.GetRealHeight(30),
-                                Width = Application.GetRealWidth(920),
-                                Height = Application.GetRealHeight(130),
-                                X = Application.GetRealWidth(80),
-                                LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                            };
-                            takebackframelayout.AddChidren(takebackrowlayout);
-
-                            var btntakeback = new Button
-                            {
-                                //Text = "鍏�",
-                                TextID = MyInternationalizationString.onoff,
-                                Width = Application.GetRealWidth(600),
-                                TextAlignment = TextAlignment.CenterLeft,
-                                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                                TextSize = 14,
-                            };
-                            takebackrowlayout.AddChidren(btntakeback);
-
-                            var takebackBtnSelected = new SelectedButton();
-                            takebackrowlayout.AddChidren(takebackBtnSelected);
-
-                            #endregion
-
-
-                            #endregion
-
-                            ///纭浜嬩欢
-                            EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                            {
-                                SelectedDeviceStatusaction = "yes";
-                                openBtnSelected.Visible = true;
-                                closeBtnSelected.Visible = false;
-                                takebackBtnSelected.Visible = false;
-                                if (switchdictionary.ContainsKey("Data1"))
-                                {
-                                    switchdictionary.Remove("Data1");
-                                }
-                                switchdictionary.Add("Data1", "1");//榛樿鍊�
-
-
-                            };
-                            openrowlayout.MouseUpEventHandler += openclick;
-                            btnopen.MouseUpEventHandler += openclick;
-                            openBtnSelected.MouseUpEventHandler += openclick;
-                            openframelayout.MouseUpEventHandler += openclick;
-                            ///鍙栨秷浜嬩欢
-                            EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                            {
-                                SelectedDeviceStatusaction = "yes";
-                                openBtnSelected.Visible = false;
-                                closeBtnSelected.Visible = true;
-                                takebackBtnSelected.Visible = false;
-                                if (switchdictionary.ContainsKey("Data1"))
-                                {
-                                    switchdictionary.Remove("Data1");
-                                }
-                                switchdictionary.Add("Data1", "0");//榛樿鍊�
-
-                            };
-                            closerowlayout.MouseUpEventHandler += closeclick;
-                            btnclose.MouseUpEventHandler += closeclick;
-                            closeBtnSelected.MouseUpEventHandler += closeclick;
-                            closeframelayout.MouseUpEventHandler += closeclick;
-                            //鍙栧弽
-                            EventHandler<MouseEventArgs> takebackclick = (sender, e) =>
-                            {
-                                SelectedDeviceStatusaction = "yes";
-                                openBtnSelected.Visible = false;
-                                closeBtnSelected.Visible = false;
-                                takebackBtnSelected.Visible = true;
-                                if (switchdictionary.ContainsKey("Data1"))
-                                {
-                                    switchdictionary.Remove("Data1");
-                                }
-                                switchdictionary.Add("Data1", "2");//榛樿鍊�
-
-                            };
-                            takebackrowlayout.MouseUpEventHandler += takebackclick;
-                            btntakeback.MouseUpEventHandler += takebackclick;
-                            takebackBtnSelected.MouseUpEventHandler += takebackclick;
-                            takebackframelayout.MouseUpEventHandler += takebackclick;
-                            if (edit && TaskList != null)
-                            {
-                                foreach (var value in TaskList)
-                                {
-                                    if (value["TaskType"] == "1")
-                                    {
-                                        if (switchdictionary.ContainsKey("Data1"))
-                                        {
-                                            switchdictionary.Remove("Data1");
-                                        }
-                                        if (value["Data1"] == "1")
-                                        {
-                                            switchdictionary.Add("Data1", "1");
-                                            openBtnSelected.Visible = true;
-                                            closeBtnSelected.Visible = false;
-                                            takebackBtnSelected.Visible = false;
-                                        }
-                                        else if (value["Data1"] == "0")
-                                        {
-                                            switchdictionary.Add("Data1", "0");
-                                            openBtnSelected.Visible = false;
-                                            closeBtnSelected.Visible = true;
-                                            takebackBtnSelected.Visible = false;
-                                        }
-                                        else if (value["Data1"] == "2")
-                                        {
-                                            switchdictionary.Add("Data1", "2");
-                                            openBtnSelected.Visible = false;
-                                            closeBtnSelected.Visible = false;
-                                            takebackBtnSelected.Visible = true;
-                                        }
-                                        break;
-                                    }
-
-                                }
-                            }
-
-                        }
-                    }
-                    break;
-
-                case DeviceType.Thermostat:
-                    {
-
-                        #region  ----鍒濆鍖栬澶囧姛鑳芥暟鎹�----
-                        Dictionary<string, string> switchdictionary = new Dictionary<string, string>();
-                        Dictionary<string, string> temperaturedictionary = new Dictionary<string, string>();
-                        Dictionary<string, string> modedictionary = new Dictionary<string, string>();
-                        Dictionary<string, string> speeddictionary = new Dictionary<string, string>();
-                        taskListInfo.Add(switchdictionary);
-                        taskListInfo.Add(temperaturedictionary);
-                        taskListInfo.Add(modedictionary);
-                        taskListInfo.Add(speeddictionary);
-                        dictionary(switchdictionary, "TaskType", "1");
-                        dictionary(switchdictionary, "Data2", "0");
-                        dictionary(temperaturedictionary, "TaskType", "5");
-                        dictionary(modedictionary, "TaskType", "5");
-                        dictionary(modedictionary, "Data1", "3");
-                        dictionary(speeddictionary, "TaskType", "5");
-                        dictionary(speeddictionary, "Data1", "6");
-
-                        #endregion
-
-                        #region  绌鸿皟View
-
-                        devicefra.Y = Application.GetRealHeight(1920 - 600 - 210 - 160 * 2);
-                        devicefra.Height = Application.GetRealHeight(600 + 210 + 160 * 2);
-
-                        #region 寮�
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-                        #endregion
-
-                        #region  绌鸿皟鐘舵�乂iew
-                        var PickerViewfra = new FrameLayout
-                        {
-                            Y = openframelayout.Bottom,
-                            Height = Application.GetRealHeight(600),
-                        };
-                        devicefra.AddChidren(PickerViewfra);
-
-
-                        var pausePickerViewfra = new FrameLayout
-                        {
-                            Y = openframelayout.Bottom,
-                            Height = Application.GetRealHeight(600),
-                        };
-                        devicefra.AddChidren(pausePickerViewfra);
-
-
-
-                        var mUIPickerView = new UIPickerView
-                        {
-                            Height = Application.GetRealHeight(600 - 5),
-                        };
-                        PickerViewfra.AddChidren(mUIPickerView);
-                        var line = new Button
-                        {
-                            Y = Application.GetRealHeight(600 - 5),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(5),
-                            X = Application.GetRealWidth(80),
-                            BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        PickerViewfra.AddChidren(line);
-
-                        var mList1 = new List<string>();
-                        var mList2 = new List<string> {
-                         Language.StringByID(MyInternationalizationString.logiccool),
-                         Language.StringByID(MyInternationalizationString.logicheat),
-                         Language.StringByID(MyInternationalizationString.logicauto),
-                         Language.StringByID(MyInternationalizationString.logicdry),
-                         Language.StringByID(MyInternationalizationString.logicfanonly),
-                        };
-                        var mList3 = new List<string>{
-                         Language.StringByID(MyInternationalizationString.logiclow),
-                         Language.StringByID(MyInternationalizationString.logicmedium),
-                         Language.StringByID(MyInternationalizationString.logichigh),
-                          };
-                        for (int i = 16; i < 33; i++)
-                        {
-                            mList1.Add(i.ToString() + " " + "鈩�");
-                        }
-                        mUIPickerView.setNPicker(mList1, mList2, mList3);
-                        ///榛樿鐘舵��
-
-
-                        #endregion
-
-                        #region  鍏�
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = PickerViewfra.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-                        #endregion
-
-
-
-                        mUIPickerView.OnSelectChangeEvent += (s1, s2, s3) =>
-                        {
-                            if (openBtnSelected.Visible)
-                            {
-                                SelectedDeviceStatusaction = "yes";
-                                var temperature = mList1[s1].Split(' ')[0];
-                                var modestring = mList2[s2].Split(' ')[0];
-                                var speedstring = mList3[s3].Split(' ')[0];
-                                ModeState(modestring, temperaturedictionary, modedictionary);
-                                var a = int.Parse(temperature) * 100;
-                                dictionary(temperaturedictionary, "Data2", a.ToString());
-
-                                SpeedState(speedstring, speeddictionary);
-
-
-                            }
-                        };
-
-                        #endregion
-                        //榛樿26,鑷姩,涓
-                        int indextemperature = 10, indexmode = 2, indexspeed = 1;
-                        if (edit && TaskList != null)
-                        {
-                            foreach (var value in TaskList)
-                            {
-                                if (value["TaskType"] == "1")
-                                {
-                                    dictionary(switchdictionary, "Data1", value["Data1"]);
-                                    if (value["Data1"] == "1")
-                                    {
-                                        openBtnSelected.Visible = true;
-                                        closeBtnSelected.Visible = false;
-                                        pausePickerViewfra.Height = Application.GetRealHeight(0);
-                                    }
-                                    else if (value["Data1"] == "0")
-                                    {
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = true;
-                                        pausePickerViewfra.Height = Application.GetRealHeight(600);
-                                    }
-
-                                }
-                                else if (value["TaskType"] == "5")
-                                {
-                                    if (value["Data1"] == "3")
-                                    {//3---璁剧疆宸ヤ綔妯″紡(1:鑷姩;3:鍒跺喎;4:鍒剁儹;7:閫侀;8:闄ゆ箍)
-                                        dictionary(modedictionary, "Data2", value["Data2"]);
-                                        string modetext = "";
-                                        switch (value["Data2"])
-                                        {
-                                            case "3":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logiccool);
-                                                    //indexmode = 0;
-                                                }
-                                                break;
-                                            case "4":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logicheat);
-                                                    //  indexmode = 1;
-                                                }
-                                                break;
-                                            case "1":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logicauto);
-                                                    //   indexmode = 2;
-                                                }
-                                                break;
-                                            case "8":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logicdry);
-                                                    //  indexmode = 3;
-                                                }
-                                                break;
-                                            case "7":
-                                                {
-                                                    modetext = Language.StringByID(MyInternationalizationString.logicfanonly);
-                                                    //indexmode = 4;
-                                                }
-                                                break;
-                                        }
-                                        indexmode = mList2.IndexOf(modetext);
-                                    }
-                                    else if (value["Data1"] == "6")
-                                    {//6---璁剧疆椋庢墖妯″紡(1:浣庨;2:涓;3:楂橀;)
-                                        dictionary(speeddictionary, "Data2", value["Data2"]);
-                                        string speedtext = "";
-                                        switch (value["Data2"])
-                                        {
-                                            case "1":
-                                                {
-                                                    speedtext = Language.StringByID(MyInternationalizationString.logiclow);
-                                                    //indexspeed = 0;
-                                                }
-                                                break;
-
-                                            case "2":
-                                                {
-                                                    speedtext = Language.StringByID(MyInternationalizationString.logicmedium);
-                                                    // indexspeed = 1;
-                                                }
-                                                break;
-                                            case "3":
-                                                {
-                                                    speedtext = Language.StringByID(MyInternationalizationString.logichigh);
-                                                    // indexspeed = 2;
-                                                }
-                                                break;
-
-                                        }
-                                        indexspeed = mList3.IndexOf(speedtext);
-                                    }
-                                    //4---璁剧疆鍔犵儹搴︽暟;5---璁剧疆鍒跺喎銆侀櫎婀垮害鏁�;7---璁剧疆鑷姩搴︽暟
-                                    else if (value["Data1"] == "4" || value["Data1"] == "5" || value["Data1"] == "7")
-                                    {
-                                        var s = int.Parse(value["Data2"]) / 100;
-                                        indextemperature = mList1.IndexOf(s.ToString() + " " + "鈩�");
-                                        dictionary(temperaturedictionary, "Data1", value["Data1"]);
-                                        dictionary(temperaturedictionary, "Data2", value["Data2"]);
-                                    }
-
-                                }
-                            }
-                        }
-                        ///鏇存柊鏈�鏂扮┖璋冪姸鎬侊紱
-                        mUIPickerView.setCurrentItems(indextemperature, indexmode, indexspeed);
-
-                        ///纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            pausePickerViewfra.Height = Application.GetRealHeight(0);
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            dictionary(switchdictionary, "Data1", "1");
-                            var temperature = mList1[indextemperature].Split(' ')[0];
-                            var modestring = mList2[indexmode].Split(' ')[0];
-                            var speedstring = mList3[indexspeed].Split(' ')[0];
-
-                            ModeState(modestring, temperaturedictionary, modedictionary);
-                            var a = int.Parse(temperature) * 100;
-                            dictionary(temperaturedictionary, "Data2", a.ToString());
-                            SpeedState(speedstring, speeddictionary);
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-
-                        ///鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            pausePickerViewfra.Height = Application.GetRealHeight(600);
-
-                            SelectedDeviceStatusaction = "yes";
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-                            dictionary(switchdictionary, "Data1", "0");
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-                    }
-                    break;
-
-
-            }
-
-            Btncomplete.MouseUpEventHandler += (sender, e) =>
-            {
-
-                if (SelectedDeviceStatusaction == "yes")
-                {
-                    LogicIfon.AddDeviceactions(common, actionsInfo);
-                }
-                else
-                {
-                    if (!edit)
-                    {
-                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
-                        Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
-                        Language.StringByID(MyInternationalizationString.confrim));
-                        alert.Show();
-                        return;
-                    }
-
-                }
-                flMain.RemoveFromParent();
-                var templatePage = new TemplatePage();
-                UserView.HomePage.Instance.AddChidren(templatePage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                templatePage.Show();
-
-            };
-
-        }
-
-        public static void dictionary(Dictionary<string, string> deviceactionsInfo, string Key, string Value)
-        {
-            if (deviceactionsInfo.ContainsKey(Key))
-            {
-                deviceactionsInfo.Remove(Key);
-            }
-            deviceactionsInfo.Add(Key, Value);
-        }
-        /// <summary>
-        /// 绌鸿皟妯″紡鐨勭姸鎬�
-        /// </summary>
-        /// <param name="modestring"></param>
-        /// <param name="temperaturedictionary"></param>
-        /// <param name="modedictionary"></param>
-        public static void ModeState(string modestring, Dictionary<string, string> temperaturedictionary, Dictionary<string, string> modedictionary)
-        {
-
-            if (modestring == Language.StringByID(MyInternationalizationString.logiccool))
-            {
-                dictionary(modedictionary, "Data2", "3");
-                dictionary(temperaturedictionary, "Data1", "5");
-            }
-            else if (modestring == Language.StringByID(MyInternationalizationString.logicheat))
-            {
-
-                dictionary(modedictionary, "Data2", "4");
-                dictionary(temperaturedictionary, "Data1", "4");
-            }
-            else if (modestring == Language.StringByID(MyInternationalizationString.logicauto))
-            {
-
-                dictionary(modedictionary, "Data2", "1");
-                dictionary(temperaturedictionary, "Data1", "7");
-            }
-            else if (modestring == Language.StringByID(MyInternationalizationString.logicdry))
-            {
-
-                dictionary(modedictionary, "Data2", "8");
-                dictionary(temperaturedictionary, "Data1", "5");
-            }
-            else if (modestring == Language.StringByID(MyInternationalizationString.logicfanonly))
-            {
-                dictionary(temperaturedictionary, "Data1", "20");
-                dictionary(modedictionary, "Data2", "7");
-            }
-
-        }
-        /// <summary>
-        /// 椋庨�熺殑妯″紡
-        /// </summary>
-        /// <param name="speedstring"></param>
-        /// <param name="speeddictionary"></param>
-        public static void SpeedState(string speedstring, Dictionary<string, string> speeddictionary)
-        {
-
-            if (speedstring == Language.StringByID(MyInternationalizationString.logiclow))
-            {
-
-                dictionary(speeddictionary, "Data2", "1");
-
-            }
-            else if (speedstring == Language.StringByID(MyInternationalizationString.logicmedium))
-            {
-
-                dictionary(speeddictionary, "Data2", "2");
-
-            }
-            else if (speedstring == Language.StringByID(MyInternationalizationString.logichigh))
-            {
-
-                dictionary(speeddictionary, "Data2", "3");
-            }
-
-        }
-
-    }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TemplateDeviceCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TemplateDeviceCondition.cs
deleted file mode 100644
index 75fd4f9..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/TemplateDeviceCondition.cs
+++ /dev/null
@@ -1,1153 +0,0 @@
-锘縰sing System;
-using Shared;
-using Shared.R;
-using System.Collections.Generic;
-using Newtonsoft.Json.Linq;
-using ZigBee.Device;
-using Shared.Common;
-namespace Shared.Phone.Device.Logic
-{
-    
-    public class TemplateDeviceCondition : FrameLayout
-    {
-        public TemplateDeviceCondition()
-        {
-            Tag = "Logic";
-
-        }
-        Button roombjButton = new Button();
-        Button roomTextButton = new Button();
-        Button devicetypeButton = new Button();
-        VerticalScrolViewLayout middle;
-        FrameLayout clickframeLayout = new FrameLayout();
-        Button clickbutton = new Button();
-        Button clicktextcolcrbutton = new Button();
-
-        public void Show()
-        {
-
-            UserView.HomePage.Instance.ScrollEnabled = false;
-            this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(160),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.addsensor,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var foolrname = new Button
-            {
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterRight,
-                X = Application.GetRealWidth(1080 - 400 - 120),
-                Width = Application.GetRealWidth(400),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                // TextID = MyInternationalizationString.customroom,
-                Text = Config.Instance.Home.GetCurrentFloorName,
-                TextSize = 14,
-            };
-            topRowLayout.AddChidren(foolrname);
-            var dropdown = new Button
-            {
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterRight,
-                X = foolrname.Right,
-                Width = Application.GetRealWidth(72),
-                Height = Application.GetRealHeight(72),
-                Y = Application.GetRealHeight(92),
-                UnSelectedImagePath = "ZigeeLogic/drop-down.png",
-            };
-            topRowLayout.AddChidren(dropdown);
-            #endregion
-
-            ///娌℃湁鎴块棿鐩存帴杩斿洖鍘伙紱
-            if (Common.Room.Lists.Count == 0)
-            {
-                return;
-            }
-            ///鎴块棿婊戝姩鎺т欢
-            var roomhorizontalScrol = new HorizontalScrolViewLayout()
-            {
-                Width = Application.GetRealWidth(1080 - 58),
-                Height = Application.GetRealHeight(200),
-                Y = topRowLayout.Bottom,
-                X = Application.GetRealWidth(58),
-            };
-            this.AddChidren(roomhorizontalScrol);
-
-           
-            ///璁惧绫诲瀷婊戝姩鎺т欢
-            var devicetypehorizontalScrol = new HorizontalScrolViewLayout()
-            {
-                Width = Application.GetRealWidth(1080 - 58),
-                Height = Application.GetRealHeight(280),
-                Y = roomhorizontalScrol.Bottom,
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                X = Application.GetRealWidth(58),
-                //Radius = (uint)Application.GetRealHeight(50),
-
-            };
-            this.AddChidren(devicetypehorizontalScrol);
-            devicetypehorizontalScrol.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
-
-            middle = new VerticalScrolViewLayout();
-            middle.Y = devicetypehorizontalScrol.Bottom + Application.GetRealHeight(40);
-            middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-            middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
-            middle.X = Application.GetRealWidth(58);
-           // middle.Radius = (uint)Application.GetRealHeight(50);
-            this.AddChidren(middle);
-            middle.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
-
-            ///鐩墠鏀寔鐨勮澶�
-            var deviceTypeList = new List<DeviceType> {
-                DeviceType.IASZone,
-                //DeviceType.OnOffSwitch,
-                //DeviceType.OnOffOutput,//妤兼鐏�
-                //DeviceType.DoorLock
-            };
-
-            ///妤煎眰鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs> foorlclick = (sender, e) =>
-            {
-
-                var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                this.AddChidren(flMain);
-                flMain.MouseUpEventHandler += (sender2, e2) =>
-                {
-                    flMain.RemoveFromParent();
-                };
-                var foolrbjicon = new FrameLayout
-                {
-
-                    Width = Application.GetRealWidth(450),
-                    Height = Application.GetRealHeight(780),
-                    X = Application.GetRealWidth(1080 - 468 - 35),
-                    Y = Application.GetRealHeight(184),
-                    BackgroundImagePath = "Item/SelectFloor_Right.png",
-                };
-                flMain.AddChidren(foolrbjicon);
-
-                var btnfoolrtext = new Button
-                {
-                    Width = Application.GetRealWidth(450),
-                    Height = Application.GetRealHeight(150),
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    X = Application.GetRealWidth(80),
-                    TextID = MyInternationalizationString.selecfoolr,
-                    TextSize = 14,
-                };
-                foolrbjicon.AddChidren(btnfoolrtext);
-
-                var foolrbj = new VerticalScrolViewLayout
-                {
-
-                    Width = Application.GetRealWidth(450),
-                    Height = foolrbjicon.Height - btnfoolrtext.Height,
-                    X = Application.GetRealWidth(80),
-                    Y = btnfoolrtext.Bottom,
-                };
-                foolrbjicon.AddChidren(foolrbj);
-
-                foreach (var foolr in Config.Instance.Home.FloorDics)
-                {
-                    var foolrRowLayout = new RowLayout
-                    {
-                        Height = Application.GetRealHeight(150),
-                        LineColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-                    };
-                    foolrbj.AddChidren(foolrRowLayout);
-
-                    var btnfoolricon = new Button
-                    {
-                        Width = Application.GetRealWidth(81),
-                        Height = Application.GetRealHeight(81),
-                        UnSelectedImagePath = "Floor/Floor.png",
-                        Gravity = Gravity.CenterVertical,
-                    };
-                    foolrRowLayout.AddChidren(btnfoolricon);
-
-
-                    var btnfoolrname = new Button
-                    {
-                        Width = Application.GetRealWidth(250),
-                        Height = Application.GetRealHeight(150),
-                        Text = foolr.Value,
-                        TextAlignment = TextAlignment.CenterLeft,
-                        TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                        Tag = foolr.Key,
-                        X = btnfoolricon.Right + Application.GetRealWidth(12),
-                        TextSize = 14,
-                    };
-                    foolrRowLayout.AddChidren(btnfoolrname);
-                    if (foolrname.Text == foolr.Value)
-                    {
-                        btnfoolricon.UnSelectedImagePath = "Floor/FloorSelected.png";
-                        btnfoolrname.TextColor = ZigbeeColor.Current.LogicTextBlackColor;
-                    }
-
-                    EventHandler<MouseEventArgs> foolrnameclick = (sender13, e13) =>
-                    {
-                        roomhorizontalScrol.RemoveAll();
-                        devicetypehorizontalScrol.RemoveAll();
-                        middle.RemoveAll();
-                        foolrname.Text = btnfoolrname.Text;
-                        flMain.RemoveFromParent();
-                        var list = Send.GetRoomList(btnfoolrname.Tag.ToString());
-                        AllRoomView(list, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
-
-                    };
-                    foolrRowLayout.MouseUpEventHandler += foolrnameclick;
-                    btnfoolrname.MouseUpEventHandler += foolrnameclick;
-
-
-                }
-
-            };
-            foolrname.MouseUpEventHandler += foorlclick;
-            dropdown.MouseUpEventHandler += foorlclick;
-
-            var roomlists = new List<Common.Room>();
-            roomlists.Clear();
-            if (Config.Instance.Home.FloorDics.Count < 2)
-            {
-                foolrname.Visible = false;
-                dropdown.Visible = false;
-                if (Config.Instance.Home.FloorDics.Count == 0)
-                {
-                    roomlists.AddRange(Common.Room.Lists);
-                }
-                else
-                {
-                    roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
-                }
-            }
-            else
-            {
-                roomlists = Send.GetRoomList(Config.Instance.Home.CurrentFloorId);
-
-            }
-
-            AllRoomView(roomlists, deviceTypeList, roomhorizontalScrol, devicetypehorizontalScrol);
-        }
-        /// <summary>
-        /// 鍔犺浇鎵�鏈夋埧闂寸殑瑙嗗浘鏂规硶
-        /// </summary>
-        void AllRoomView(List<Common.Room> roomlist, List<DeviceType> deviceTypeList, HorizontalScrolViewLayout roomhorizontalScrol, HorizontalScrolViewLayout devicetypehorizontalScrol)
-        {
-            for (int i = 0; i < roomlist.Count; i++)
-            {
-                var room = roomlist[i];
-
-                var fra = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(200),
-                    Width = Application.GetRealWidth(255),
-                };
-                roomhorizontalScrol.AddChidren(fra);
-
-                var roombjBtn = new Button
-                {
-                    Height = Application.GetRealHeight(158),
-                    Width = Application.GetRealWidth(255),
-                    UnSelectedImagePath = "ZigeeLogic/iconBackgroundColor.png",
-                    SelectedImagePath = "ZigeeLogic/iconSelectedBackgroundColor.png",
-                    Y = Application.GetRealHeight(21),
-                };
-                fra.AddChidren(roombjBtn);
-
-                var roomnameBtn = new Button
-                {
-
-                    Height = Application.GetRealHeight(152 - 26 - 20),
-                    Width = Application.GetRealWidth(255 - 20 - 50),
-                    Text = room.Name,
-                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                    SelectedTextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    Y = Application.GetRealHeight(21 + 13 + 10),
-                    X = Application.GetRealWidth(10 + 25),
-
-                };
-                fra.AddChidren(roomnameBtn);
-
-                if (i == 0)//
-                {
-                    roombjButton.IsSelected = false;
-                    roombjButton = roombjBtn;
-                    roombjBtn.IsSelected = true;
-
-                    roomTextButton.IsSelected = false;
-                    roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
-
-                    var list = new List<DeviceUI>();
-                    foreach (var device in room.DeviceUIList)
-                    {
-                        if (device.CommonDevice == null)
-                        {
-                            continue;
-                        }
-                        if (!deviceTypeList.Contains(device.CommonDevice.Type))
-                        {
-                            continue;
-                        }
-                        list.Add(device);
-                    }
-                    if (list.Count == 0)
-                    {
-                        devicetypehorizontalScrol.Height = 0;
-                   
-                        middle.Height = 0;
-                    }
-                    else
-                    {
-                        devicetypehorizontalScrol.Height = Application.GetRealHeight(280);
-                        
-                        middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-                    }
-                    AllDeviceTypeView(list, devicetypehorizontalScrol);
-
-                }
-
-
-                EventHandler<MouseEventArgs> roomclick = (sender, e) =>
-                {
-
-
-                    roombjButton.IsSelected = false;
-                    roombjButton = roombjBtn;
-                    roombjBtn.IsSelected = true;
-
-                    roomTextButton.IsSelected = false;
-                    roomTextButton = roomnameBtn;
-                    roomnameBtn.IsSelected = true;
-
-                    var list = new List<DeviceUI>();
-                    foreach (var device in room.DeviceUIList)
-                    {
-                        if (device.CommonDevice == null)
-                        {
-                            continue;
-                        }
-                        if (!deviceTypeList.Contains(device.CommonDevice.Type))
-                        {
-                            continue;
-                        }
-                        list.Add(device);
-                    }
-                    if (list.Count == 0)
-                    {
-                        devicetypehorizontalScrol.Height = 0;
-                       
-                        middle.Height = 0;
-                    }
-                    else
-                    {
-                        devicetypehorizontalScrol.Height = Application.GetRealHeight(280);
-                      
-                        middle.Height = Application.GetRealHeight(1920 - 40) - devicetypehorizontalScrol.Bottom;
-                    }
-                    AllDeviceTypeView(list, devicetypehorizontalScrol);
-
-
-                };
-                roomnameBtn.MouseUpEventHandler += roomclick;
-                roombjBtn.MouseUpEventHandler += roomclick;
-
-            }
-        }
-        /// <summary>
-        /// 鍔犺浇璇ュ尯鍩熸墍鏈夎澶囪鍥炬柟娉�
-        /// </summary>0
-        /// <param name="devicelist">Devicelist.</param>
-        void AllDeviceTypeView(List<DeviceUI> devicelist, HorizontalScrolViewLayout devicetypehorizontalScrol)
-        {
-            List<string> devicetypelist = new List<string>();
-            devicetypelist.Clear();
-            #region  ------鎺掑垪璁惧绫诲瀷------
-            ///鏆傛椂闅愯棌鐏厜鍜岀獥甯樿澶�
-            var lightjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.ColorDimmableLight || device.CommonDevice.Type == DeviceType.OnOffOutput);
-            if (lightjosn != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Lights));
-            }
-            var curtainjosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.WindowCoveringDevice);
-            if (curtainjosn != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.Curtains));
-            }
-
-            var iASZonejosn = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.IASZone);
-            if (iASZonejosn != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.sensor));
-            }
-            var onOffSwitchjson = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.OnOffSwitch);
-            if (onOffSwitchjson != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.OnOffSwitch));
-            }
-            var doorLock = devicelist.Find((device) => device.CommonDevice.Type == DeviceType.DoorLock);
-            if (doorLock != null)
-            {
-                devicetypelist.Add(Language.StringByID(MyInternationalizationString.doorLock));
-            }
-            #endregion
-
-            devicetypehorizontalScrol.RemoveAll();
-            for (int i = 0; i < devicetypelist.Count; i++)
-            {
-
-                var devicetype = devicetypelist[i];
-
-                var spaceRowLayout = new FrameLayout();
-                devicetypehorizontalScrol.AddChidren(spaceRowLayout);
-                if (i == 0)
-                {
-                    spaceRowLayout.Width = Application.GetRealWidth(37);
-                }
-                else
-                {
-                    spaceRowLayout.Width = Application.GetRealWidth(80);
-                }
-
-                var deviceRowLayout = new FrameLayout
-                {
-                    Width = Application.GetRealWidth(156 + 20),
-                    Height = Application.GetRealHeight(280 - 30),
-                    Y = Application.GetRealHeight(30),
-                };
-                devicetypehorizontalScrol.AddChidren(deviceRowLayout);
-
-                var backgroundColor = new Button
-                {
-                    Width = Application.GetRealWidth(156),
-                    Height = Application.GetRealHeight(180),
-                    X = Application.GetRealWidth(10),
-                    UnSelectedImagePath = "ZigeeLogic/deviceunselectedbackgroundcolor.png",
-                    SelectedImagePath = "ZigeeLogic/deviceselectedbackgroundcolor.png",
-                };
-                deviceRowLayout.AddChidren(backgroundColor);
-
-
-                var devicetypeicon = new Button
-                {
-                    Width = Application.GetRealWidth(84),
-                    Height = Application.GetRealHeight(84),
-                    X = Application.GetRealWidth(46),
-                    Y = Application.GetRealHeight(30),
-                };
-                deviceRowLayout.AddChidren(devicetypeicon);
-
-                var devicetypename = new Button
-                {
-                    Width = Application.GetRealWidth(176),
-                    Height = Application.GetRealHeight(40),
-                    Text = devicetype,
-                    TextAlignment = TextAlignment.Center,
-                    Y = backgroundColor.Bottom,
-                    TextColor = ZigbeeColor.Current.LogicAddColor,
-                    TextSize = 10,
-                };
-                deviceRowLayout.AddChidren(devicetypename);
-                if (devicetype == Language.StringByID(MyInternationalizationString.Lights))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedlight.png";
-                    // devicetypeicon.SelectedImagePath = "ZigeeLogic/LightSelected.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.Curtains))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedcurtain.png";
-                    //devicetypeicon.SelectedImagePath = "ZigeeLogic/CurtainSelected.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.OnOffSwitch))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedpanel.png";
-                    // devicetypeicon.SelectedImagePath = "ZigeeLogic/OnOffSwitchSelected.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.sensor))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selectedsenor.png";
-                    // devicetypeicon.SelectedImagePath = "ZigeeLogic/SensorSelected.png";
-                }
-                else if (devicetype == Language.StringByID(MyInternationalizationString.doorLock))
-                {
-                    devicetypeicon.UnSelectedImagePath = "ZigeeLogic/selecteddoorlock.png";
-                }
-                EventHandler<MouseEventArgs> devicetypeclick = (sender13, e13) =>
-                {
-                    List<DeviceType> list = new List<DeviceType>();
-                    list.Clear();
-                    devicetypeButton.IsSelected = false;
-                    devicetypeButton = backgroundColor;
-                    backgroundColor.IsSelected = true;
-                    ///鍒嗙被鏄剧ず锛堜緥濡傜伅鍏夛細{鐏厜1锛岀伅鍏�2...}锛�
-                    if (devicetype == Language.StringByID(MyInternationalizationString.Lights))
-                    {
-                        list.Add(DeviceType.OnOffOutput);//0x0101鍗佽繘鍒�257
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.Curtains))
-                    {
-                        list.Add(DeviceType.WindowCoveringDevice);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.OnOffSwitch))
-                    {
-                        list.Add(DeviceType.OnOffSwitch);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.sensor))
-                    {
-                        list.Add(DeviceType.IASZone);
-                    }
-                    else if (devicetype == Language.StringByID(MyInternationalizationString.doorLock))
-                    {
-                        list.Add(DeviceType.DoorLock);
-                    }
-
-                    ConditionDeviceView(list, devicelist);
-
-                };
-                deviceRowLayout.MouseUpEventHandler += devicetypeclick;
-                devicetypename.MouseUpEventHandler += devicetypeclick;
-                devicetypeicon.MouseUpEventHandler += devicetypeclick;
-                backgroundColor.MouseUpEventHandler += devicetypeclick;
-
-            }
-            ///鏄剧ず鎴块棿鎵�鏈夎澶�
-            ConditionDeviceView(new List<DeviceType>(), devicelist);
-
-        }
-        /// <summary>
-        /// 鍔犺浇璇ョ被鍨嬭澶囪鍥炬柟娉�
-        /// </summary>
-        /// <param name="deviceTypelist">Device typelist.</param>
-        /// <param name="devicelist">璁惧鍒楄〃</param>
-        void ConditionDeviceView(List<DeviceType> deviceTypelist, List<DeviceUI> devicelist)
-        {
-            middle.RemoveAll();
-
-            foreach (var common in devicelist)
-            {
-
-                if (deviceTypelist.Count != 0 && !deviceTypelist.Contains(common.CommonDevice.Type))
-                {
-                    continue;
-                }
-                if (common.CommonDevice.Type == DeviceType.IASZone)
-                {
-                    var iASZonedevice = common.CommonDevice as IASZone;
-                    if (iASZonedevice.DeviceID != 1026 || iASZonedevice.IasDeviceType != 13)
-                    {
-                        continue;
-                    }
-                }
-
-                var deviceFramelayout = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(160),
-                };
-                middle.AddChidren(deviceFramelayout);
-
-                var bjFramelayout = new FrameLayout
-                {
-                    Width = Application.GetRealWidth(112),
-                    Height = Application.GetRealHeight(112),
-                    X = Application.GetRealWidth(58),
-                    Y = Application.GetRealHeight(30 + 9),
-                    Radius = (uint)Application.GetRealHeight(56),
-                    BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-                };
-                deviceFramelayout.AddChidren(bjFramelayout);
-
-                var deviceIconBtn = new Button
-                {
-                    Width = Application.GetRealWidth(82),
-                    Height = Application.GetRealHeight(82),
-                    Gravity = Gravity.Center,
-
-                };
-                bjFramelayout.AddChidren(deviceIconBtn);
-
-                var deviceRow = new RowLayout
-                {
-                    Y = Application.GetRealHeight(30),
-                    Width = Application.GetRealWidth(850),
-                    Height = Application.GetRealHeight(130),
-                    X = Application.GetRealWidth(176 + 10),
-                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-
-                };
-                deviceFramelayout.AddChidren(deviceRow);
-
-                var devicename = new Button
-                {
-                    Text = common.CommonDevice.DeviceEpointName,
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    SelectedTextColor = ZigbeeColor.Current.LogicAddColor,
-                    TextSize = 14,
-                };
-                deviceRow.AddChidren(devicename);
-                switch (common.CommonDevice.Type)
-                {
-                    case DeviceType.OnOffOutput:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/light.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedlight.png";
-                        }
-                        break;
-                    case DeviceType.IASZone:
-                        {
-                            var iASZonedevice = common.CommonDevice as IASZone;
-                            if (iASZonedevice.DeviceID != 1026)
-                            {
-                                break;
-                            }
-                            deviceIconBtn.UnSelectedImagePath = $"ZigeeLogic/sensor{iASZonedevice.IasDeviceType}.png";
-                            deviceIconBtn.SelectedImagePath = $"ZigeeLogic/selectedsensor{iASZonedevice.IasDeviceType}.png";
-
-
-                        }
-                        break;
-                    case DeviceType.OnOffSwitch:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/panel.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selectedpanel.png";
-                        }
-                        break;
-                    case DeviceType.DoorLock:
-                        {
-                            deviceIconBtn.UnSelectedImagePath = "ZigeeLogic/doorlock.png";
-                            deviceIconBtn.SelectedImagePath = "ZigeeLogic/selecteddoorlock.png";
-                        }
-                        break;
-                }
-
-                EventHandler<MouseEventArgs> devicclick = (sen, e) =>
-                {
-                    clickbutton.IsSelected = false;
-                    clickbutton = deviceIconBtn;
-                    deviceIconBtn.IsSelected = true;
-                    clickframeLayout.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-                    clickframeLayout = bjFramelayout;
-                    bjFramelayout.BackgroundColor = ZigbeeColor.Current.LogicIconBackgroundColor;
-                    clicktextcolcrbutton.IsSelected = false;
-                    clicktextcolcrbutton = devicename;
-                    devicename.IsSelected = true;
-                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                    this.AddChidren(flMain);
-                    CurrentDeviceView(flMain, common.CommonDevice, false);
-                };
-                deviceFramelayout.MouseUpEventHandler += devicclick;
-                bjFramelayout.MouseUpEventHandler += devicclick;
-                deviceIconBtn.MouseUpEventHandler += devicclick;
-                deviceRow.MouseUpEventHandler += devicclick;
-                devicename.MouseUpEventHandler += devicclick;
-
-
-            }
-        }
-        /// <summary>
-        /// 閫変腑璇ヨ澶囧姛鑳戒綔涓烘潯浠剁殑瑙嗗浘鏂规硶
-        /// </summary>
-        /// <param name="common">Common.</param>
-        public async static void CurrentDeviceView(FrameLayout flMain, CommonDevice common, bool edit)
-        {
-            //涓嶈褰撳墠鐣岄潰婊戝姩
-            UserView.HomePage.Instance.ScrollEnabled = false;
-            List<Dictionary<string, string>> doorlockConditionsInfo = new List<Dictionary<string, string>>();
-            Dictionary<string, string> deviceConditionsInfo = new Dictionary<string, string>();
-            dictionary(deviceConditionsInfo, "Type", "1");
-            dictionary(deviceConditionsInfo, "IsValid", "1");
-            dictionary(deviceConditionsInfo, "MacAddr", common.DeviceAddr);
-            dictionary(deviceConditionsInfo, "Epoint", common.DeviceEpoint.ToString());
-            //var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-            //this.AddChidren(flMain);
-            flMain.MouseUpEventHandler += (sender, e) =>
-            {
-                flMain.RemoveFromParent();
-
-
-            };
-
-
-            var devicefra = new FrameLayout
-            {
-
-                Width = Application.GetRealWidth(1080),
-                Height = Application.GetRealHeight(530),
-                Y = Application.GetRealHeight(1920 - 530),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                Radius = (uint)Application.GetRealHeight(60),
-            };
-            flMain.AddChidren(devicefra);
-            devicefra.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
-
-            #region  -------鍙栨秷   瀹屾垚
-            var timetype = new RowLayout
-            {
-                Height = Application.GetRealHeight(140),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            devicefra.AddChidren(timetype);
-            var Btncancel = new Button
-            {
-                TextID = MyInternationalizationString.cancel,
-                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                X = Application.GetRealWidth(80),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextSize = 14,
-            };
-            timetype.AddChidren(Btncancel);
-            Btncancel.MouseUpEventHandler += (sender16, e16) =>
-            {
-                flMain.RemoveFromParent();
-                UserView.HomePage.Instance.ScrollEnabled = true;
-            };
-
-            var Btntitle = new Button
-            {
-                TextID = MyInternationalizationString.security,
-                TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(420),
-                TextAlignment = TextAlignment.Center,
-                X = Btncancel.Right + Application.GetRealWidth(50),
-                TextSize = 16,
-                Text = common.DeviceEpointName,
-            };
-            timetype.AddChidren(Btntitle);
-            var Btncomplete = new Button
-            {
-                TextID = MyInternationalizationString.complete,
-                TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                TextAlignment = TextAlignment.CenterRight,
-                X = Btntitle.Right + Application.GetRealWidth(50),
-                TextSize = 14,
-
-            };
-            timetype.AddChidren(Btncomplete);
-            #endregion
-
-            string SelectedDeviceStatuscondition = "";
-
-            Dictionary<string, string> devices = null;
-            if (edit)
-            {
-                foreach (var deviceinfo in Common.Logic.CurrentLogic.Conditions)
-                {
-                    if (deviceinfo["Type"] == "1")
-                    {
-                        if (common.DeviceAddr == deviceinfo["MacAddr"] && common.DeviceEpoint.ToString() == deviceinfo["Epoint"])
-                        {
-                            devices = deviceinfo;
-                            break;
-
-                        }
-                    }
-                }
-            }
-            switch (common.Type)
-            {
-                case DeviceType.IASZone:
-                    {
-
-                        var iASZonedevice = common as IASZone;
-                        if (iASZonedevice.DeviceID != 1026)
-                        {
-                            break;
-                        }
-
-                        dictionary(deviceConditionsInfo, "Cluster_ID", "1280");
-                        dictionary(deviceConditionsInfo, "AttriButeId", "1281");
-                        dictionary(deviceConditionsInfo, "AttriButeData2", "0");
-
-                        #region  瀹夐槻璁惧View
-
-                        var openframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = timetype.Bottom + Application.GetRealHeight(20),
-                        };
-                        devicefra.AddChidren(openframelayout);
-
-                        var openrowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                        };
-                        openframelayout.AddChidren(openrowlayout);
-
-                        var btnopen = new Button
-                        {
-                            Width = Application.GetRealWidth(600),
-                            TextID = MyInternationalizationString.open,
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        openrowlayout.AddChidren(btnopen);
-
-                        var openBtnSelected = new SelectedButton();
-                        openrowlayout.AddChidren(openBtnSelected);
-
-
-                        var closeframelayout = new FrameLayout
-                        {
-                            Height = Application.GetRealHeight(160),
-                            Y = openframelayout.Bottom,
-                        };
-                        devicefra.AddChidren(closeframelayout);
-                        var closerowlayout = new RowLayout
-                        {
-                            Y = Application.GetRealHeight(30),
-                            Width = Application.GetRealWidth(920),
-                            Height = Application.GetRealHeight(130),
-                            X = Application.GetRealWidth(80),
-                            LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                        };
-                        closeframelayout.AddChidren(closerowlayout);
-
-                        var btnclose = new Button
-                        {
-                            //Text = "鍏�",
-                            TextID = MyInternationalizationString.close,
-                            Width = Application.GetRealWidth(600),
-                            TextAlignment = TextAlignment.CenterLeft,
-                            TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                            TextSize = 14,
-                        };
-                        closerowlayout.AddChidren(btnclose);
-
-                        var closeBtnSelected = new SelectedButton();
-                        closerowlayout.AddChidren(closeBtnSelected);
-
-
-                        #endregion
-
-                        int timevalue = 0;
-                        ///鐐瑰嚮纭浜嬩欢
-                        EventHandler<MouseEventArgs> openclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatuscondition = "IASZone";
-                            btnopen.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                            btnclose.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                            openBtnSelected.Visible = true;
-                            closeBtnSelected.Visible = false;
-                            if (iASZonedevice.IasDeviceType == 13)
-                            {
-                                closeBtnSelected.Visible = true;
-                            }
-                            dictionary(deviceConditionsInfo, "Range", "5");
-                            dictionary(deviceConditionsInfo, "AttriButeData1", "1");
-
-
-                        };
-                        openrowlayout.MouseUpEventHandler += openclick;
-                        btnopen.MouseUpEventHandler += openclick;
-                        openBtnSelected.MouseUpEventHandler += openclick;
-                        openframelayout.MouseUpEventHandler += openclick;
-                        ///鐐瑰嚮鍙栨秷浜嬩欢
-                        EventHandler<MouseEventArgs> closeclick = (sender, e) =>
-                        {
-                            SelectedDeviceStatuscondition = "IASZone";
-                            btnopen.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                            btnclose.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                            openBtnSelected.Visible = false;
-                            closeBtnSelected.Visible = true;
-                            dictionary(deviceConditionsInfo, "Range", "1");
-                            dictionary(deviceConditionsInfo, "AttriButeData1", "0");
-                            if (iASZonedevice.IasDeviceType == 13)
-                            {
-                                SelectedDeviceStatuscondition = "";
-                                btnopen.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                btnclose.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                openBtnSelected.Visible = false;
-                                closeBtnSelected.Visible = true;
-                                var ignoreTime = new TemplateIgnore();
-                                UserView.HomePage.Instance.AddChidren(ignoreTime);
-                                UserView.HomePage.Instance.PageIndex += 1;
-                                ignoreTime.Show(common, btnclose.Text, edit, timevalue);
-                            }
-
-
-                        };
-                        closerowlayout.MouseUpEventHandler += closeclick;
-                        btnclose.MouseUpEventHandler += closeclick;
-                        closeBtnSelected.MouseUpEventHandler += closeclick;
-                        closeframelayout.MouseUpEventHandler += closeclick;
-
-
-
-                        switch (iASZonedevice.IasDeviceType)
-                        {
-                            case 13:
-                                {
-                                    btnopen.TextID = MyInternationalizationString.someone;
-                                    btnclose.TextID = MyInternationalizationString.unattendedtime1;
-                                    closeBtnSelected.UnSelectedImagePath = "ZigeeLogic/next.png";
-                                    closeBtnSelected.Visible = true;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    closeframelayout.AddChidren(closerowlayout);
-                                }
-                                break;
-                            case 21:
-                            case 22:
-                                {
-                                    #region
-                                    devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 * 3 - 20 - 50);
-                                    devicefra.Height = Application.GetRealHeight(140 + 160 * 3 + 20 + 50);
-                                    btnopen.TextID = MyInternationalizationString.logicopen;
-                                    btnclose.TextID = MyInternationalizationString.logicclose;
-                                    closerowlayout.LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    closeframelayout.AddChidren(closerowlayout);
-
-
-
-                                    var timeoutframelayout = new FrameLayout
-                                    {
-                                        Height = Application.GetRealHeight(160),
-                                        Y = closeframelayout.Bottom,
-                                    };
-                                    devicefra.AddChidren(timeoutframelayout);
-                                    var timeoutrowlayout = new RowLayout
-                                    {
-                                        Y = Application.GetRealHeight(30),
-                                        Width = Application.GetRealWidth(920),
-                                        Height = Application.GetRealHeight(130),
-                                        X = Application.GetRealWidth(80),
-                                        LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                                    };
-                                    timeoutframelayout.AddChidren(timeoutrowlayout);
-
-                                    var btntimeout = new Button
-                                    {
-                                        TextID = MyInternationalizationString.closetimeout,
-                                        Width = Application.GetRealWidth(600),
-                                        TextAlignment = TextAlignment.CenterLeft,
-                                        TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                                    };
-                                    timeoutrowlayout.AddChidren(btntimeout);
-
-                                    var timeoutBtnSelected = new Button
-                                    {
-                                        X = Application.GetRealWidth(860),
-                                        Width = Application.GetMinRealAverage(60),
-                                        Height = Application.GetMinRealAverage(60),
-                                        UnSelectedImagePath = "ZigeeLogic/next.png",
-                                        Gravity = Gravity.CenterVertical,
-                                    };
-                                    timeoutrowlayout.AddChidren(timeoutBtnSelected);
-                                    EventHandler<MouseEventArgs> timeoutclick = (sender, e) =>
-                                    {
-                                        SelectedDeviceStatuscondition = "";
-                                        btnopen.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                        btnclose.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = false;
-                                        var ignoreTime = new TemplateIgnore();
-                                        UserView.HomePage.Instance.AddChidren(ignoreTime);
-                                        UserView.HomePage.Instance.PageIndex += 1;
-                                        ignoreTime.Show(common, btntimeout.Text, edit, timevalue);
-
-                                    };
-                                    timeoutframelayout.MouseUpEventHandler += timeoutclick;
-                                    timeoutrowlayout.MouseUpEventHandler += timeoutclick;
-                                    btntimeout.MouseUpEventHandler += timeoutclick;
-                                    timeoutBtnSelected.MouseUpEventHandler += timeoutclick;
-
-                                    #endregion
-                                }
-                                break;
-                            case 40:
-                                {
-                                    devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 - 20 - 50);
-                                    devicefra.Height = Application.GetRealHeight(140 + 160 + 20 + 50);
-                                    btnopen.TextID = MyInternationalizationString.smokescreen;
-                                    //btnclose.TextID = MyInternationalizationString.nosmokescreen;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    openrowlayout.LineColor = ZigbeeColor.Current.LogicBackgroundColor;
-                                }
-                                break;
-                            case 42:
-                                {
-                                    btnopen.TextID = MyInternationalizationString.waterleakage;
-                                    btnclose.TextID = MyInternationalizationString.noleakage;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    closeframelayout.AddChidren(closerowlayout);
-
-                                }
-                                break;
-                            case 43:
-                                {
-                                    devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 - 20 - 50);
-                                    devicefra.Height = Application.GetRealHeight(140 + 160 + 20 + 50);
-                                    btnopen.TextID = MyInternationalizationString.gas;
-                                    //btnclose.TextID = MyInternationalizationString.nogas;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    openrowlayout.LineColor = ZigbeeColor.Current.LogicBackgroundColor;
-                                }
-                                break;
-                            case 44:
-                                {
-                                    devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 - 20 - 50);
-                                    devicefra.Height = Application.GetRealHeight(140 + 160 + 20 + 50);
-                                    btnopen.TextID = MyInternationalizationString.emergencybutton;
-                                    //btnclose.TextID = MyInternationalizationString.nosmokescreen;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    openrowlayout.LineColor = ZigbeeColor.Current.LogicBackgroundColor;
-                                }
-                                break;
-                            case 277:
-                                {
-                                    devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 - 20 - 50);
-                                    devicefra.Height = Application.GetRealHeight(140 + 160 + 20 + 50);
-                                    btnopen.TextID = MyInternationalizationString.callthepolice;
-                                    //btnclose.TextID = MyInternationalizationString.nosmokescreen;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    openrowlayout.LineColor = ZigbeeColor.Current.LogicBackgroundColor;
-                                }
-                                break;
-                            default:
-                                {
-                                    devicefra.Y = Application.GetRealHeight(1920 - 140 - 160 - 20 - 50);
-                                    devicefra.Height = Application.GetRealHeight(140 + 160 + 20 + 50);
-                                    btnopen.TextID = MyInternationalizationString.callthepolice;
-                                    openframelayout.AddChidren(openrowlayout);
-                                    openrowlayout.LineColor = ZigbeeColor.Current.LogicBackgroundColor;
-                                }
-                                break;
-                        }
-                        if (edit && devices != null)
-                        {
-                            if (devices["AttriButeId"] == "1281")
-                            {
-                                if (devices["AttriButeData1"] == "1")
-                                {
-                                    btnopen.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                                    btnclose.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                    openBtnSelected.Visible = true;
-                                    closeBtnSelected.Visible = false;
-                                }
-                                else
-                                {
-                                    if (devices.ContainsKey("IgnoreTime"))
-                                    {
-                                        timevalue = int.Parse(devices["IgnoreTime"]);
-                                    }
-                                    else
-                                    {
-                                        btnopen.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                                        btnclose.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                                        openBtnSelected.Visible = false;
-                                        closeBtnSelected.Visible = true;
-                                    }
-                                }
-                            }
-
-
-                        }
-
-                    }
-                    break;
-
-            }
-
-            Btncomplete.MouseUpEventHandler += (sender2, e2) =>
-            {
-                //UserView.HomePage.Instance.ScrollEnabled = true;
-                if (SelectedDeviceStatuscondition != "")
-                {
-                    LogicIfon.AddDeviceconditions(common, deviceConditionsInfo);
-                }
-                else
-                {
-                    if (!edit)
-                    {
-                        var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
-                         Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
-                         Language.StringByID(MyInternationalizationString.confrim));
-                        alert.Show();
-                        return;
-                    }
-
-                }
-                flMain.RemoveFromParent();
-                var templatePage = new TemplatePage();
-                UserView.HomePage.Instance.AddChidren(templatePage);
-                UserView.HomePage.Instance.PageIndex += 1;
-                templatePage.Show();
-
-            };
-
-
-        }
-
-        public static void dictionary(Dictionary<string, string> deviceConditionsInfo, string Key, string Value)
-        {
-            if (deviceConditionsInfo.ContainsKey(Key))
-            {
-                deviceConditionsInfo.Remove(Key);
-            }
-            deviceConditionsInfo.Add(Key, Value);
-        }
-
-
-
-    }
-
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TemplateIgnore.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TemplateIgnore.cs
deleted file mode 100644
index f410c1d..0000000
--- a/ZigbeeApp/Shared/Phone/Device/Logic/TemplateIgnore.cs
+++ /dev/null
@@ -1,264 +0,0 @@
-锘縰sing System;
-using System.Collections.Generic;
-using Shared;
-using Shared.Common;
-using Shared.R;
-using ZigBee.Device;
-namespace Shared.Phone.Device.Logic
-{
-    public class TemplateIgnore:FrameLayout
-    {
-        public TemplateIgnore()
-        {
-            Tag = "Logic";
-
-        }
-        Button selectedIcon = new Button();
-        public void Show(CommonDevice common, string name, bool edit, int timevalue)
-        {
-
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                Text = name,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-            #endregion
-
-            var middle = new VerticalScrolViewLayout
-            {
-                Y = topRowLayout.Bottom,
-                Height = Application.GetRealHeight(1920 - 184 - 260),
-                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-            };
-            this.AddChidren(middle);
-            int selectetimedvalue = 0;
-            var timestrlist = new List<string> { "2", "5", "10", "20", "30", Language.StringByID(MyInternationalizationString.logiccustom) };
-            foreach (var intvalue in timestrlist)
-            {
-
-                var timeframelayout = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(160),
-                    BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                };
-                middle.AddChidren(timeframelayout);
-
-                var timeniconBtn = new Button
-                {
-                    Width = Application.GetRealWidth(81),
-                    Height = Application.GetRealHeight(81),
-                    X = Application.GetRealWidth(58),
-                    Y = Application.GetRealHeight(55),
-                    UnSelectedImagePath = "ZigeeLogic/point.png",
-
-                };
-                timeframelayout.AddChidren(timeniconBtn);
-
-                var timeRow = new RowLayout
-                {
-                    Y = Application.GetRealHeight(30),
-                    Width = Application.GetRealWidth(850),
-                    Height = Application.GetRealHeight(130),
-                    X = Application.GetRealWidth(176),
-                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                };
-                timeframelayout.AddChidren(timeRow);
-
-                var timeBtn = new Button
-                {
-                    Text = intvalue.ToString() + Language.StringByID(MyInternationalizationString.Minute),
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    Tag = intvalue,
-                    TextSize = 15,
-                };
-                timeRow.AddChidren(timeBtn);
-
-
-                var selected = new SelectedButton(789);
-                timeRow.AddChidren(selected);
-                //鍒ゆ柇涓�涓瓧绗︽槸瀛楃涓茶繕鏄暟瀛�
-                if (intvalue.Length < 3)
-                {
-                    if (timevalue == int.Parse(intvalue) * 60)
-                    {
-                        selectedIcon.Visible = false;
-                        selectedIcon = selected;
-                        selected.Visible = true;
-                    }
-                }
-                else
-                {
-                    timeRow.LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
-                }
-                EventHandler<MouseEventArgs> timeclick = (sender, e) =>
-                {
-                    selectedIcon.Visible = false;
-                    selectedIcon = selected;
-                    selected.Visible = true;
-                    if (Language.StringByID(MyInternationalizationString.logiccustom) == timeBtn.Tag.ToString())
-                    {
-                        var secondList = new List<string>();
-                        var minuteList = new List<string>();
-                        for (int i = 0; i < 61; i++)
-                        {
-                            if (i < 10)
-                            {
-                                var a = "0" + i.ToString();
-                                secondList.Add(a + " " + Language.StringByID(MyInternationalizationString.second));
-                                minuteList.Add(a + " " + Language.StringByID(MyInternationalizationString.minute));
-                            }
-                            else
-                            {
-                                secondList.Add(i.ToString() + " " + Language.StringByID(MyInternationalizationString.second));
-                                minuteList.Add(i.ToString() + " " + Language.StringByID(MyInternationalizationString.minute));
-                            }
-
-                        }
-                        int selectIndex1 = 0;
-                        int selectIndex2 = 0;
-                        if (timevalue > 3600)
-                        {
-                            selectIndex1 = 60;
-                            selectIndex2 = timevalue - 3600;
-                        }
-                        else
-                        {
-                            selectIndex1 = timevalue / 60;
-                            selectIndex2 = timevalue % 60;
-                        }
-                        PickerView.ShowNormal(minuteList, secondList, new List<string>(), (Index1, Index2, Index3) =>
-                        {
-                            selectetimedvalue = int.Parse(minuteList[Index1].Split(' ')[0]) * 60 + int.Parse(secondList[Index2].Split(' ')[0]);
-                            timemethod(common, selectetimedvalue, timevalue, edit);
-                        }, selectIndex1, selectIndex2, 0, Language.StringByID(MyInternationalizationString.logiccustom));
-                    }
-                    else
-                    {
-                        selectetimedvalue = int.Parse(timeBtn.Tag.ToString()) * 60;
-                    }
-                };
-                timeframelayout.MouseUpEventHandler += timeclick;
-                timeniconBtn.MouseUpEventHandler += timeclick;
-                timeRow.MouseUpEventHandler += timeclick;
-                timeBtn.MouseUpEventHandler += timeclick;
-                selected.MouseUpEventHandler += timeclick;
-            }
-
-            var saveFrameLayout = new FrameLayout
-            {
-                Y = middle.Bottom,
-                Height = Application.GetRealHeight(260),
-                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-            };
-            this.AddChidren(saveFrameLayout);
-
-            var btnsave = new Button
-            {
-                X = Application.GetRealWidth(85),
-                Height = Application.GetRealHeight(130),//194
-                Width = Application.GetRealWidth(910),
-                Radius = (uint)Application.GetRealHeight(60),
-                BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
-                TextID = MyInternationalizationString.Save,
-                TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                TextSize = 16,
-            };
-            saveFrameLayout.AddChidren(btnsave);
-            btnsave.MouseUpEventHandler += (sender, e) =>
-            {
-                timemethod(common, selectetimedvalue, timevalue, edit);
-            };
-        }
-
-        public void timemethod(CommonDevice common, int selectetimedvalue, int timevalue, bool edit)
-        {
-
-            var deviceConditionsInfo = new Dictionary<string, string>();
-            deviceConditionsInfo.Add("Type", "1");
-            deviceConditionsInfo.Add("IsValid", "1");
-            deviceConditionsInfo.Add("MacAddr", common.DeviceAddr);
-            deviceConditionsInfo.Add("Epoint", common.DeviceEpoint.ToString());
-            deviceConditionsInfo.Add("Cluster_ID", "1280");
-            deviceConditionsInfo.Add("AttriButeId", "1281");
-            deviceConditionsInfo.Add("AttriButeData1", "0");
-            deviceConditionsInfo.Add("AttriButeData2", "0");
-            deviceConditionsInfo.Add("Range", "1");
-            if (selectetimedvalue != 0)
-            {
-                if (timevalue != selectetimedvalue)
-                {
-                    if (deviceConditionsInfo.ContainsKey("IgnoreTime"))
-                    {
-                        deviceConditionsInfo.Remove("IgnoreTime");
-                    }
-                    deviceConditionsInfo.Add("IgnoreTime", selectetimedvalue.ToString());
-                    LogicIfon.AddDeviceconditions(common, deviceConditionsInfo);
-                }
-
-            }
-            else
-            {
-                if (!edit)
-                {
-
-                    var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
-                      Language.StringByID(MyInternationalizationString.delaytip),
-                      Language.StringByID(MyInternationalizationString.confrim));
-                    alert.Show();
-                    return;
-                }
-
-            }
-            var templatePage = new TemplatePage();
-            UserView.HomePage.Instance.AddChidren(templatePage);
-            UserView.HomePage.Instance.PageIndex += 1;
-            templatePage.Show();
-
-        }
-    }
-}
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs
index 9231d7a..33feefe 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/TemplatePage.cs
@@ -26,72 +26,26 @@
         {
 
             #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.selection,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
             if (Common.Logic.CurrentLogic.LogicId != 0)
             {
-                titleName.Text = Language.StringByID(MyInternationalizationString.editautomation);
+                view.toptitleNameBtn.Text = Language.StringByID(MyInternationalizationString.editautomation);
             }
             else
             {
-                titleName.Text = Language.StringByID(MyInternationalizationString.newautomation);
+                view.toptitleNameBtn.Text = Language.StringByID(MyInternationalizationString.newautomation);
             }
-
-            var clickBtn = new Button
+            view.clickBtn.MouseDownEventHandler += (sender, e) =>
             {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
+                
                 RemoveFromParent();
             };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-
-
             #endregion
-
-
 
             var middle = new VerticalScrolViewLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184 - 180),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
@@ -160,61 +114,13 @@
             #region -----鏄剧ず閫昏緫鏉′欢-----
 
 
-            var conditionFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(conditionFrameLayout);
+            LogicView.Addview addconditionview = new LogicView.Addview();
+            addconditionview.iconBtn.Visible = true;
+            addconditionview.titleBtn.TextID = MyInternationalizationString.ifcondition;
+            middle.AddChidren(addconditionview.AddDeviceView());
 
-
-            var conditionRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            conditionFrameLayout.AddChidren(conditionRowLayout);
-
-
-            conditionRowLayout.AddChidren(new Button
-            {
-
-                Text = Language.StringByID(MyInternationalizationString.ifcondition),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(60),
-                TextSize = 15,
-                Gravity = Gravity.CenterVertical,
-            });
-
-            var conditionadd1 = new Button
-            {
-
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(57),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(965 + 58),
-
-            };
-            conditionFrameLayout.AddChidren(conditionadd1);
-
-            var conditionadd = new Button
-            {
-
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/add.png",
-                X = Application.GetRealWidth(965 - 58),
-                Gravity = Gravity.CenterVertical,
-
-            };
-            conditionRowLayout.AddChidren(conditionadd);
             ///娣诲姞鏉′欢鐨勭偣鍑讳簨浠�
-            EventHandler<MouseEventArgs> conditionaddclick = (sender, e) =>
+            addconditionview.clickBtn.MouseUpEventHandler += (sender, e) =>
             {
                 if (Common.Logic.CurrentLogic.Conditions.Count == 1)
                 {
@@ -222,19 +128,14 @@
                 }
                 else
                 {
-                    Common.Logic.LogicDviceList.Clear();
-                    if (Common.Logic.LogicDviceList.Count == 0)
-                    {
-                        Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
-                    }
-                    var templateDeviceCondition = new TemplateDeviceCondition();
-                    UserView.HomePage.Instance.AddChidren(templateDeviceCondition);
+                    var roomAndDeviceView = new RoomAndDeviceView();
+                    UserView.HomePage.Instance.AddChidren(roomAndDeviceView);
                     UserView.HomePage.Instance.PageIndex += 1;
-                    templateDeviceCondition.Show();
+                    roomAndDeviceView.IfType = "condition_mould";
+                    roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.addsensor));
                 }
             };
-            conditionadd.MouseUpEventHandler += conditionaddclick;
-            conditionadd1.MouseUpEventHandler += conditionaddclick;
+           
             List<Dictionary<string, string>> ListConditions = new List<Dictionary<string, string>>();
             ListConditions.Clear();
             ListConditions.AddRange(Common.Logic.CurrentLogic.Conditions);
@@ -277,37 +178,10 @@
             {
                 if (i == (ListConditions.Count - 1))
                 {
-
-                    var addfl = new FrameLayout
-                    {
-                        Height = Application.GetRealHeight(160 + 30 + 50),
-                        BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    };
-                    middle.AddChidren(addfl);
-                    var addbtn = new Button
-                    {
-                        Height = Application.GetRealHeight(130 + 50),
-                        Width = Application.GetRealWidth(908),
-                        Y = Application.GetRealHeight(30),
-                        X = Application.GetRealWidth(86),
-                        UnSelectedImagePath = "ZigeeLogic/logicaddcolor.png",
-                    };
-                    addfl.AddChidren(addbtn);
-
-
-                    var addtextbtn = new Button
-                    {
-                        Height = Application.GetRealHeight(58),
-                        Width = Application.GetRealWidth(400),
-                        Y = Application.GetRealHeight(45 + 30),
-                        TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                        TextID = MyInternationalizationString.addsensor,
-                        X = Application.GetRealWidth(340),
-                        TextSize = 14,
-                    };
-                    addfl.AddChidren(addtextbtn);
-
-                    EventHandler<MouseEventArgs> addconditionsclick = (sender, e) =>
+                    LogicView.AddDeviceView addflview = new LogicView.AddDeviceView();
+                    addflview.titleBtn.TextID = MyInternationalizationString.addsensor;
+                    middle.AddChidren(addflview.AddFl());
+                    addflview.clickBtn.MouseUpEventHandler += (sender, e) =>
                     {
                         if (Common.Logic.CurrentLogic.Conditions.Count == 1)
                         {
@@ -315,115 +189,33 @@
                         }
                         else
                         {
-                            var templateDeviceCondition = new TemplateDeviceCondition();
-                            UserView.HomePage.Instance.AddChidren(templateDeviceCondition);
+
+                            var roomAndDeviceView = new RoomAndDeviceView();
+                            UserView.HomePage.Instance.AddChidren(roomAndDeviceView);
                             UserView.HomePage.Instance.PageIndex += 1;
-                            templateDeviceCondition.Show();
+                            roomAndDeviceView.IfType = "condition_mould";
+                            roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.addsensor));
                         }
                     };
-                    addbtn.MouseUpEventHandler += addconditionsclick;
-                    addtextbtn.MouseUpEventHandler += addconditionsclick;
                 }
                 else
                 {
-                    var devicesFrameLayout = new FrameLayout
-                    {
-                        Height = Application.GetRealHeight(130),
-                        BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    };
-                    middle.AddChidren(devicesFrameLayout);
-
-                    ///鏄剧ず鍥炬爣
-                    var conditionIcon = new Button
-                    {
-                        Width = Application.GetRealWidth(81),
-                        Height = Application.GetRealHeight(81),
-                        X = Application.GetRealWidth(104),
-                        Y = Application.GetRealHeight(25),
-                        UnSelectedImagePath = "ZigeeLogic/sensor13.png",
-
-                    };
-                    devicesFrameLayout.AddChidren(conditionIcon);
-
-
-                    var conditionsRowLayout = new RowLayout
-                    {
-                        Width = Application.GetRealWidth(800),
-                        Height = Application.GetRealHeight(130),
-                        X = Application.GetRealWidth(222),
-                        LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                    };
-                    devicesFrameLayout.AddChidren(conditionsRowLayout);
-
+                    SelectedDeviceView selecteddevice = new SelectedDeviceView();
+                    selecteddevice.Show(middle);
                     var Type = int.Parse(ListConditions[i]["Type"]);
                     var conditions = ListConditions[i];
                     switch (Type)
                     {
 
-                        /// (0:鏃堕棿鐐规潯浠�;1:璁惧鐘舵�佸彉鍖栨潯浠�;2:鍏朵粬閫昏緫鏉′欢;3:璁℃暟鍣ㄦ潯浠�;4:鍊掕鏃�;5:鏃堕棿娈垫潯浠�;6:瀹夐槻鏉′欢;7:鍦扮悊浣嶇疆)
+                        /// 1:璁惧鐘舵�佸彉鍖栨潯浠�;
                         case 1:
                             {
-                                var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return obj.DeviceAddr == conditions["MacAddr"] && obj.DeviceEpoint.ToString() == conditions["Epoint"]; });
-                                if (deviceinof == null)
-                                {
-                                    continue;
-                                }
-                                ///鏄剧ず璁惧鍚嶇О
-                                var btndevice = new Button
-                                {
-                                    Y = Application.GetRealHeight(20),
-                                    Height = Application.GetRealHeight(50),
-                                    Width = Application.GetRealWidth(400),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Text = deviceinof.DeviceEpointName,
-                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                                    TextSize = 14,
-                                };
-                                conditionsRowLayout.AddChidren(btndevice);
-
-                                ///鍖哄煙(鎴块棿)鍚嶇ОButton
-                                var btnregionname = new Button
-                                {
-                                    Y = btndevice.Bottom + Application.GetRealHeight(10),
-                                    Width = Application.GetRealWidth(400),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Height = Application.GetRealHeight(50),
-                                    Text = "",//Language.StringByID(MyInternationalizationString.customroom),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                };
-                                conditionsRowLayout.AddChidren(btnregionname);
-                                ///閫氳繃璁惧鎵惧埌鍖哄煙(鎴块棿)鍚嶇О
-                                Send.RoomNmae(btnregionname, deviceinof);
-
-
-                                var deviceedit = new Button
-                                {
-                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
-                                    Text = Language.StringByID(MyInternationalizationString.edit),
-                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                                };
-                                conditionsRowLayout.AddRightView(deviceedit);
-                                deviceedit.MouseUpEventHandler += (sender, e) =>
-                                {
-                                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                                    this.AddChidren(flMain);
-                                    TemplateDeviceCondition.CurrentDeviceView(flMain, deviceinof, true);
-
-                                };
-
-                                ///鏄剧ず璁惧鏉′欢鐘舵�佹帶浠�
-                                var devicestatus = new Button
-                                {
-                                    Width = Application.GetRealWidth(400),
-                                    Height = Application.GetRealHeight(130),
-                                    Gravity = Gravity.CenterVertical,
-                                    TextAlignment = TextAlignment.CenterRight,
-                                    X = Application.GetRealWidth(400),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    TextSize = 14,
-                                };
-                                conditionsRowLayout.AddChidren(devicestatus);
-
+                                var deviceinof = Method.GetCommonDevice(conditions["MacAddr"], conditions["Epoint"]);
+                                selecteddevice.deviceNameBtn.Visible = true;
+                                selecteddevice.deviceNameBtn.Text = deviceinof.DeviceEpointName;
+                                selecteddevice.regionNameBtn.Visible = true;
+                                Method.RoomNmae(selecteddevice.regionNameBtn, deviceinof);
+                                selecteddevice.iconBtn.UnSelectedImagePath ="ZigeeLogic/sensor13.png";
                                 switch (deviceinof.Type)
                                 {
                                     case DeviceType.IASZone:
@@ -436,7 +228,7 @@
                                                     {
                                                         if (intvalue == "1")
                                                         {
-                                                            devicestatus.TextID = MyInternationalizationString.someone;
+                                                            selecteddevice.selecetddevicestateBtn.TextID = MyInternationalizationString.someone;
                                                         }
                                                         else
                                                         {
@@ -444,19 +236,19 @@
                                                             int second = int.Parse(conditions["IgnoreTime"]) % 60;
                                                             if (minute != 0 && second != 0)
                                                             {
-                                                                devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1);
+                                                                selecteddevice.selecetddevicestateBtn.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.minute) + second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1);
 
                                                             }
                                                             else
                                                             {
                                                                 if (minute == 0 && second != 0)
                                                                 {
-                                                                    devicestatus.Text = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1);
+                                                                    selecteddevice.selecetddevicestateBtn.Text = second.ToString() + Language.StringByID(MyInternationalizationString.second) + Language.StringByID(MyInternationalizationString.unattendedtime1);
 
                                                                 }
                                                                 if (minute != 0 && second == 0)
                                                                 {
-                                                                    devicestatus.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1);
+                                                                    selecteddevice.selecetddevicestateBtn.Text = minute.ToString() + Language.StringByID(MyInternationalizationString.Minute) + Language.StringByID(MyInternationalizationString.unattendedtime1);
 
                                                                 }
 
@@ -464,17 +256,6 @@
                                                         }
                                                     }
                                                     break;
-                                               
-                                                default:
-                                                    {
-                                                        conditionIcon.UnSelectedImagePath = "ZigeeLogic/infraredsensor.png";
-                                                        if (intvalue == "1")
-                                                        {
-                                                            devicestatus.TextID = MyInternationalizationString.callthepolice;
-                                                        }
-                                                    }
-                                                    break;
-
                                             }
                                         }
                                         break;
@@ -484,19 +265,23 @@
                             }
                             break;
                     }
-                    ///鍒犻櫎鎺т欢
-                    var del = new Button
+                 
+                    ///缂栬緫
+                    selecteddevice.edit.MouseUpEventHandler += (sender, e) =>
                     {
-                        BackgroundColor = ZigbeeColor.Current.LogicDelBlackColor1,
-                        Text = Language.StringByID(MyInternationalizationString.del),
-                    };
-                    conditionsRowLayout.AddRightView(del);
+                        var deviceinof = Method.GetCommonDevice(conditions["MacAddr"], conditions["Epoint"]);
+                        var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
+                        this.AddChidren(flMain);
+                        CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "condition_mould");
 
-                    del.MouseUpEventHandler += (sender, e) =>
+                    };
+                    ///鍒犻櫎鎺т欢
+                    selecteddevice.del.MouseUpEventHandler += (sender, e) =>
                     {
+
                         var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
-                       Language.StringByID(MyInternationalizationString.doyouwanttodelete),
-                       Language.StringByID(MyInternationalizationString.confrim));
+                   Language.StringByID(MyInternationalizationString.doyouwanttodelete),
+                   Language.StringByID(MyInternationalizationString.confrim));
                         alert.Show();
                         alert.ConfirmClickEvent += () =>
                         {
@@ -506,9 +291,7 @@
                             UserView.HomePage.Instance.PageIndex += 1;
                             templatePage.Show();
                         };
-
                     };
-
                 }
             }
 
@@ -517,67 +300,20 @@
 
             #region  ----鏄剧ず鎵ц鐩爣----
 
-            var targetFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(targetFrameLayout);
-
-
-            var targetRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            targetFrameLayout.AddChidren(targetRowLayout);
-
-
-            var btntargettitle = new Button
-            {
-
-                Text = Language.StringByID(MyInternationalizationString.execute),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(60),
-                TextSize = 15,
-                Gravity = Gravity.CenterVertical,
-            };
-            targetRowLayout.AddChidren(btntargettitle);
-
-            var btntargetadd1 = new Button
-            {
-
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(57),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(965 + 58),
-            };
-            targetFrameLayout.AddChidren(btntargetadd1);
-
-            var btntargetadd = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/add.png",
-                X = Application.GetRealWidth(965 - 58),
-                Gravity = Gravity.CenterVertical,
-            };
-            targetRowLayout.AddChidren(btntargetadd);
-            EventHandler<MouseEventArgs> btntargetaddclick = (sender, e) =>
+            LogicView.Addview addactionview = new LogicView.Addview();
+            addactionview.iconBtn.Visible = true;
+            addactionview.titleBtn.TextID = MyInternationalizationString.execute;
+            middle.AddChidren(addactionview.AddDeviceView());
+            addactionview.clickBtn.MouseUpEventHandler = (sender, e) =>
             {
                 Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
-                var templateDeviceAction = new TemplateDeviceAction();
-                UserView.HomePage.Instance.AddChidren(templateDeviceAction);
+
+                var roomAndDeviceView = new RoomAndDeviceView();
+                UserView.HomePage.Instance.AddChidren(roomAndDeviceView);
                 UserView.HomePage.Instance.PageIndex += 1;
-                templateDeviceAction.Show();
+                roomAndDeviceView.IfType = "action_mould";
+                roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.addlighting));
             };
-            btntargetadd1.MouseUpEventHandler += btntargetaddclick;
-            btntargetadd.MouseUpEventHandler += btntargetaddclick;
 
             List<Dictionary<string, object>> ListActions = new List<Dictionary<string, object>>();
             ListActions.Clear();
@@ -588,79 +324,24 @@
             {
                 if (i == (ListActions.Count - 1))
                 {
-
-                    var addfl = new FrameLayout
+                    LogicView.AddDeviceView addflview = new LogicView.AddDeviceView();
+                    addflview.titleBtn.TextID = MyInternationalizationString.addlighting;
+                    middle.AddChidren(addflview.AddFl());
+                    addflview.clickBtn.MouseUpEventHandler += (sender, e) =>
                     {
-                        Height = Application.GetRealHeight(160 + 30 + 50),
-                        BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    };
-                    middle.AddChidren(addfl);
-                    var addbtn = new Button
-                    {
-                        Height = Application.GetRealHeight(130 + 50),
-                        Width = Application.GetRealWidth(908),
-                        Y = Application.GetRealHeight(30),
-                        X = Application.GetRealWidth(86),
-                        UnSelectedImagePath = "ZigeeLogic/logicaddcolor.png",
-                    };
-                    addfl.AddChidren(addbtn);
-
-
-                    var addtextbtn = new Button
-                    {
-                        Height = Application.GetRealHeight(58),
-                        Width = Application.GetRealWidth(400),
-                        Y = Application.GetRealHeight(45 + 30),
-                        TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                        TextID = MyInternationalizationString.addlighting,
-                        X = Application.GetRealWidth(340),
-                        TextSize = 14,
-                    };
-                    addfl.AddChidren(addtextbtn);
-                    EventHandler<MouseEventArgs> addfunctionclick = (sender, e) =>
-                    {
-                        Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
-                        var templateDeviceAction = new TemplateDeviceAction();
-                        UserView.HomePage.Instance.AddChidren(templateDeviceAction);
+                        var roomAndDeviceView = new RoomAndDeviceView();
+                        UserView.HomePage.Instance.AddChidren(roomAndDeviceView);
                         UserView.HomePage.Instance.PageIndex += 1;
-                        templateDeviceAction.Show();
+                        roomAndDeviceView.IfType = "action_mould";
+                        roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.addlighting));
                     };
-                    addbtn.MouseUpEventHandler += addfunctionclick;
-                    addtextbtn.MouseUpEventHandler += addfunctionclick;
+
                 }
                 else
                 {
 
-                    var devicesFrameLayout = new FrameLayout
-                    {
-                        Height = Application.GetRealHeight(130),
-                        BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    };
-                    middle.AddChidren(devicesFrameLayout);
-
-                    ///鏄剧ず鍥炬爣
-                    var actionsIcon = new Button
-                    {
-                        Width = Application.GetRealWidth(81),
-                        Height = Application.GetRealHeight(81),
-                        X = Application.GetRealWidth(104),
-                        Y = Application.GetRealHeight(25),
-                        // UnSelectedImagePath = "ZigeeLogic/time.png",
-
-                    };
-                    devicesFrameLayout.AddChidren(actionsIcon);
-
-
-                    var actionsrowLayout = new RowLayout
-                    {
-                        Width = Application.GetRealWidth(800),
-                        Height = Application.GetRealHeight(130),
-                        X = Application.GetRealWidth(222),
-                        LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                    };
-                    devicesFrameLayout.AddChidren(actionsrowLayout);
-
-
+                    SelectedDeviceView actiondevice = new SelectedDeviceView();
+                    actiondevice.Show(middle);
                     var linkType = int.Parse(ListActions[i]["LinkType"].ToString());
                     var actions = ListActions[i];
 
@@ -668,76 +349,16 @@
                     {
                         case 0:
                             {
-                                var obj1 = actions["DeviceAddr"].ToString();
-                                var obj2 = actions["Epoint"].ToString();
-                                var deviceinof = Common.Logic.LogicDviceList.Find((obj) => { return ((obj.DeviceAddr == obj1) && (obj.DeviceEpoint.ToString() == obj2)); });
-                                if (deviceinof == null)
-                                {
-                                    continue;
-                                }
-
-                                ///璁惧鍚嶇ОButton
-                                var btndevicename = new Button
-                                {
-                                    Y = Application.GetRealHeight(20),
-                                    Height = Application.GetRealHeight(50),
-                                    Width = Application.GetRealWidth(450),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Text = deviceinof.DeviceEpointName,
-                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                                    TextSize = 14,
-                                };
-                                actionsrowLayout.AddChidren(btndevicename);
-
-                                ///鍖哄煙(鎴块棿)鍚嶇ОButton
-                                var btnregionname = new Button
-                                {
-                                    Y = btndevicename.Bottom + Application.GetRealHeight(10),
-                                    Width = Application.GetRealWidth(450),
-                                    TextAlignment = TextAlignment.CenterLeft,
-                                    Height = Application.GetRealHeight(50),
-                                    Text = "",//Language.StringByID(MyInternationalizationString.customroom),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                };
-                                actionsrowLayout.AddChidren(btnregionname);
-                                ///閫氳繃璁惧鎵惧埌鍖哄煙(鎴块棿)鍚嶇О
-                                Send.RoomNmae(btnregionname, deviceinof);
-                                ///鏄剧ず璁惧鏉′欢鐘舵�佹帶浠�
-                                var devicestatus = new Button
-                                {
-                                    Width = Application.GetRealWidth(350),
-                                    Height = Application.GetRealHeight(130),
-                                    Gravity = Gravity.CenterVertical,
-                                    TextAlignment = TextAlignment.CenterRight,
-                                    X = Application.GetRealWidth(450),
-                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                                    TextSize = 14,
-                                };
-                                actionsrowLayout.AddChidren(devicestatus);
-
-                                ///缂栬緫璁惧鐘舵�丅utton
-                                var deviceedit = new Button
-                                {
-                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
-                                    Text = Language.StringByID(MyInternationalizationString.edit),
-                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                                };
-                                actionsrowLayout.AddRightView(deviceedit);
-
-                                ///缂栬緫鐐瑰嚮浜嬩欢
-                                deviceedit.MouseUpEventHandler += (sender, e) =>
-                                {
-                                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                                    this.AddChidren(flMain);
-                                    TemplateDeviceAction.CurrentDeviceStateView(flMain, deviceinof, true);
-                                };
-
-
+                                var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString());
+                                actiondevice.deviceNameBtn.Visible = true;
+                                actiondevice.deviceNameBtn.Text = deviceinof.DeviceEpointName;
+                                actiondevice.regionNameBtn.Visible = true;
+                                Method.RoomNmae(actiondevice.regionNameBtn, deviceinof);
                                 switch (deviceinof.Type)
                                 {
                                     case DeviceType.OnOffOutput:
                                         {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/light.png";
+                                            actiondevice.iconBtn.UnSelectedImagePath = "ZigeeLogic/light.png";
 
                                             var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
                                             if (TaskList == null)
@@ -750,250 +371,41 @@
                                                 {
                                                     if (status["Data1"].ToString() == "0")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
+                                                        actiondevice.selecetddevicestateBtn.Text = Language.StringByID(MyInternationalizationString.close);
 
                                                     }
                                                     else if (status["Data1"].ToString() == "1")
                                                     {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.open);
+                                                        actiondevice.selecetddevicestateBtn.Text = Language.StringByID(MyInternationalizationString.open);
 
                                                     }
                                                     else if (status["Data1"].ToString() == "2")
                                                     {
 
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.onoff);
-                                                    }
-                                                }
-
-                                            }
-
-                                        }
-                                        break;
-                                    case DeviceType.DimmableLight:
-                                        {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/dimmableLight.png";
-                                            var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
-                                            if (TaskList == null)
-                                            {
-                                                continue;
-                                            }
-                                            foreach (var status in TaskList)
-                                            {
-                                                if (status["TaskType"].ToString() == "3")
-                                                {
-                                                    var intvalue = int.Parse(status["Data1"]);
-                                                    var lightbrightnessvalue = (intvalue * 100) / 254;
-                                                    devicestatus.Text = lightbrightnessvalue.ToString() + "%";
-                                                }
-                                                else if (status["TaskType"].ToString() == "1")
-                                                {
-
-                                                    if (status["Data1"].ToString() == "0")
-                                                    {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
-                                                    }
-                                                    else if (status["Data1"].ToString() == "2")
-                                                    {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.onoff);
-                                                    }
-                                                }
-
-
-                                            }
-
-                                        }
-                                        break;
-                                    case DeviceType.WindowCoveringDevice:
-                                        {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/curtain.png";
-                                            var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
-                                            if (TaskList == null)
-                                            {
-                                                continue;
-                                            }
-                                            foreach (var status in TaskList)
-                                            {
-                                                if (status["TaskType"] == "6")
-                                                {
-                                                    if (status["Data1"] == "0")
-                                                    {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.open);
-                                                    }
-                                                    else if (status["Data1"] == "1")
-                                                    {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
-                                                    }
-                                                    else if (status["Data1"] == "5")
-                                                    {
-                                                        devicestatus.Text = status["Data2"] + "%";
+                                                        actiondevice.selecetddevicestateBtn.Text = Language.StringByID(MyInternationalizationString.onoff);
                                                     }
                                                 }
 
                                             }
                                         }
                                         break;
-                                    case DeviceType.AirSwitch:
-                                        {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/airswitch.png";
-
-                                            var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
-                                            if (TaskList == null)
-                                            {
-                                                continue;
-                                            }
-                                            foreach (var status in TaskList)
-                                            {
-                                                if (status["TaskType"].ToString() == "1")
-                                                {
-                                                    if (status["Data1"].ToString() == "0")
-                                                    {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
-
-                                                    }
-                                                    else if (status["Data1"].ToString() == "1")
-                                                    {
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.open);
-
-                                                    }
-                                                    else if (status["Data1"].ToString() == "2")
-                                                    {
-
-                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.onoff);
-                                                    }
-                                                }
-
-                                            }
-
-                                        }
-                                        break;
-                                    case DeviceType.Thermostat:
-                                        {
-                                            actionsIcon.UnSelectedImagePath = "ZigeeLogic/ac.png";
-
-                                            var TaskList = actions["TaskList"] as List<Dictionary<string, string>>;
-                                            if (TaskList == null)
-                                            {
-                                                continue;
-                                            }
-                                            string modetext = "", temperaturetext = "", speedtext = "";
-                                            bool ifclose = false;
-                                            foreach (var status in TaskList)
-                                            {
-                                                if (status["TaskType"].ToString() == "1")
-                                                {
-                                                    if (status["Data1"].ToString() == "0")
-                                                    {
-                                                        // devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
-
-                                                        ifclose = false;
-                                                    }
-                                                    else if (status["Data1"].ToString() == "1")
-                                                    {
-                                                        //devicestatus.Text = Language.StringByID(MyInternationalizationString.open);
-                                                        ifclose = true;
-                                                    }
-
-                                                }
-                                                else if (status["TaskType"].ToString() == "5")
-                                                {
-                                                    if (status["Data1"] == "3")
-                                                    {//3---璁剧疆宸ヤ綔妯″紡(1:鑷姩;3:鍒跺喎;4:鍒剁儹;7:閫侀;8:闄ゆ箍)
-                                                        switch (status["Data2"])
-                                                        {
-                                                            case "3":
-                                                                {
-                                                                    modetext = Language.StringByID(MyInternationalizationString.logiccool);
-                                                                }
-                                                                break;
-                                                            case "4":
-                                                                {
-                                                                    modetext = Language.StringByID(MyInternationalizationString.logicheat);
-                                                                }
-                                                                break;
-                                                            case "1":
-                                                                {
-                                                                    modetext = Language.StringByID(MyInternationalizationString.logicauto);
-                                                                }
-                                                                break;
-                                                            case "8":
-                                                                {
-                                                                    modetext = Language.StringByID(MyInternationalizationString.logicdry);
-                                                                }
-                                                                break;
-                                                            case "7":
-                                                                {
-                                                                    modetext = Language.StringByID(MyInternationalizationString.logicfanonly);
-                                                                }
-                                                                break;
-                                                        }
-                                                    }
-                                                    else if (status["Data1"] == "6")
-                                                    {//6---璁剧疆椋庢墖妯″紡(1:浣庨;2:涓;3:楂橀;)
-                                                        switch (status["Data2"])
-                                                        {
-                                                            case "1":
-                                                                {
-                                                                    speedtext = Language.StringByID(MyInternationalizationString.logiclow);
-                                                                }
-                                                                break;
-
-                                                            case "2":
-                                                                {
-                                                                    speedtext = Language.StringByID(MyInternationalizationString.logicmedium);
-                                                                }
-                                                                break;
-                                                            case "3":
-                                                                {
-                                                                    speedtext = Language.StringByID(MyInternationalizationString.logichigh);
-                                                                }
-                                                                break;
-
-                                                        }
-                                                    }
-                                                    //4---璁剧疆鍔犵儹搴︽暟;5---璁剧疆鍒跺喎銆侀櫎婀垮害鏁�;7---璁剧疆鑷姩搴︽暟
-                                                    else if (status["Data1"] == "4" || status["Data1"] == "5" || status["Data1"] == "7")
-                                                    {
-                                                        var s = int.Parse(status["Data2"]) / 100;
-                                                        temperaturetext = s.ToString();
-                                                    }
-                                                    else if (status["Data1"] == "20")
-                                                    {
-                                                        temperaturetext = "鏃�";
-                                                    }
-
-
-                                                }
-
-                                            }
-                                            if (ifclose)
-                                            {
-                                                devicestatus.Text = modetext + ";" + temperaturetext + "鈩�;" + speedtext;
-                                            }
-                                            else
-                                            {
-                                                devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
-
-                                            }
-                                        }
-                                        break;
-
+                                  
                                 }
-
-
                             }
                             break;
                     }
-                    ///鍒犻櫎鎺т欢
-                    var del = new Button
-                    {
-                        BackgroundColor = ZigbeeColor.Current.LogicDelBlackColor1,
-                        Text = Language.StringByID(MyInternationalizationString.del),
+                    ///缂栬緫
+                    actiondevice.edit.MouseUpEventHandler += (sender, e) => {
+                        var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
+                        this.AddChidren(flMain);
+                        var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString());
+                        CurrentDeviceState.CurrentDeviceView(flMain, deviceinof, true, "action_mould");
                     };
-                    actionsrowLayout.AddRightView(del);
-
-                    del.MouseUpEventHandler += (sender, e) =>
+                    ///鍒犻櫎鎺т欢
+                    actiondevice.del.MouseUpEventHandler += (sender, e) =>
                     {
-                     
+
+
                         var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
                      Language.StringByID(MyInternationalizationString.doyouwanttodelete),
                      Language.StringByID(MyInternationalizationString.confrim));
@@ -1006,7 +418,6 @@
                             UserView.HomePage.Instance.PageIndex += 1;
                             templatePage.Show();
                         };
-
                     };
 
                 }
@@ -1023,34 +434,12 @@
             middle.AddChidren(fraline1);
 
 
-            var weekFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(weekFrameLayout);
-            var weekRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            weekFrameLayout.AddChidren(weekRowLayout);
-
-            var settxet = new Button
-            {
-                Text = Language.StringByID(MyInternationalizationString.setupcycle),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(60),
-                Gravity = Gravity.CenterVertical,
-                TextSize = 14,
-            };
-            weekRowLayout.AddChidren(settxet);
-            var btnweektext = new Button
+            LogicView.Addview weekview = new LogicView.Addview();
+            weekview.iconBtn.Visible = true;
+            weekview.iconBtn.UnSelectedImagePath = "ZigeeLogic/next.png";
+            weekview.titleBtn.TextID = MyInternationalizationString.setupcycle;
+            middle.AddChidren(weekview.AddDeviceView());
+            var weekBtn = new Button
             {
                 Width = Application.GetRealWidth(595),
                 Height = Application.GetRealHeight(60),
@@ -1058,29 +447,17 @@
                 //Text = "姣忓ぉ",
                 TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                 TextID = MyInternationalizationString.everyday,
-                Y = Application.GetRealHeight(35),
-                X = settxet.Right,
+                Y = Application.GetRealHeight(35 + 30),
+                X = weekview.titleBtn.Right,
                 TextSize = 14,
             };
-            weekRowLayout.AddChidren(btnweektext);
+            weekview.frameLayout.AddChidren(weekBtn);
 
-            var nextBtn = new Button
-            {
-
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = Application.GetRealWidth(965 - 58),
-                Gravity = Gravity.CenterVertical,
-
-            };
-            weekRowLayout.AddChidren(nextBtn);
-
-            UpdateWeek(btnweektext);
+            Method.UpdateWeek(weekBtn, Common.Logic.CurrentLogic);
             EventHandler<MouseEventArgs> cycleclick = (sender, e) =>
             {
                 /*------淇濈暀姣忔湀,姣忓勾绫诲瀷*/
-                var cycle = new Cycle(() => { UpdateWeek(btnweektext); });
+                var cycle = new Cycle(() => { Method.UpdateWeek(weekBtn, Common.Logic.CurrentLogic); });
                 UserView.HomePage.Instance.AddChidren(cycle);
                 UserView.HomePage.Instance.PageIndex += 1;
                 cycle.Show();
@@ -1090,697 +467,129 @@
                 //UserView.HomePage.Instance.PageIndex += 1;
                 //cyclicCycle.Show();
             };
-            btnweektext.MouseUpEventHandler += cycleclick;
-            nextBtn.MouseUpEventHandler += cycleclick;
+            weekBtn.MouseUpEventHandler += cycleclick;
+            weekview.clickBtn.MouseUpEventHandler += cycleclick;
             #endregion
 
             #region  ----鎺ㄩ�佽缃�----
-
-            var pushFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(pushFrameLayout);
-
-            var pushswitchRowlayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            pushFrameLayout.AddChidren(pushswitchRowlayout);
-
-            var btnswitchtxet = new Button
-            {
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(60),
-                Gravity = Gravity.CenterVertical,
-                TextID = MyInternationalizationString.pushswitch,
-                TextSize = 14,
-            };
-            pushswitchRowlayout.AddChidren(btnswitchtxet);
-
-            var btnswitch = new Button
-            {
-                Width = Application.GetMinRealAverage(104),
-                Height = Application.GetMinRealAverage(63),
-                UnSelectedImagePath = "ZigeeLogic/logicclose.png",
-                SelectedImagePath = "ZigeeLogic/logicopen.png",
-                X = Application.GetRealWidth(965 - 104),
-                Gravity = Gravity.CenterVertical,
-            };
-            pushswitchRowlayout.AddChidren(btnswitch);
-          
-
-
-            var custompushFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(0),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(custompushFrameLayout);
-
-            var custompushRowLayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            custompushFrameLayout.AddChidren(custompushRowLayout);
-
-            var btncustompush = new Button
-            {
-                TextID = MyInternationalizationString.custompush,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(300),
-                Height = Application.GetRealHeight(60),
-                Gravity = Gravity.CenterVertical,
-                TextSize = 14,
-            };
-            custompushRowLayout.AddChidren(btncustompush);
-
-
-            var custompushback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = Application.GetRealWidth(965 - 58),
-                Gravity = Gravity.CenterVertical,
-            };
-            custompushRowLayout.AddChidren(custompushback);
-            EventHandler<MouseEventArgs> customclick = (sender, e) =>
-            {
-                var CustomText = new CustomText();
-                UserView.HomePage.Instance.AddChidren(CustomText);
-                UserView.HomePage.Instance.PageIndex += 1;
-                CustomText.Show();
-
-            };
-            btncustompush.MouseUpEventHandler += customclick;
-            custompushback.MouseUpEventHandler += customclick;
-            custompushRowLayout.MouseUpEventHandler += customclick;
-
+            Method.Push(middle);
             #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,
-                Height = Application.GetRealHeight(180),
-                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-            };
-            this.AddChidren(saveFrameLayout);
-
-            var btnsave = new Button
-            {
-                X = Application.GetRealWidth(85),
-                Height = Application.GetRealHeight(130),//194
-                Width = Application.GetRealWidth(910),
-                Radius = (uint)Application.GetRealHeight(60),
-                BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
-                TextID = MyInternationalizationString.application,
-                TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-            };
-            saveFrameLayout.AddChidren(btnsave);
-            btnsave.MouseUpEventHandler += async (sender, e) =>
+            var saveBtn = new LogicView.SaveView();
+            saveBtn.frameLayout.Y = middle.Bottom;
+            saveBtn.frameLayout.Height = Application.GetRealHeight(180);
+            this.AddChidren(saveBtn.Show());
+            saveBtn.clickviewBtn.MouseUpEventHandler +=(sender, e) =>
             {
                 var name = logicTextBox.Text.Trim();
-                //if (Common.Logic.CurrentLogic.Conditions.Count != 0 && Common.Logic.CurrentLogic.Actions.Count != 0)
-                //{
-                //    AddChidren(btnsave);
-                //}
-                if (string.IsNullOrEmpty(logicTextBox.Text.Trim()))
-                {
-                    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;
-                //}
-
-                Common.Logic.CurrentLogic.LogicName = name;
-
-                //鍒ゆ柇鏄柊娣诲姞閫昏緫(榛樿0)杩樻槸淇敼閫昏緫
-                CommonPage.Loading.Start();
-                if (Common.Logic.CurrentLogic.LogicId == 0)
-                {
-                    //鍙戦�佹坊鍔犻�昏緫鍛戒护
-                    var logicifon = await Send.AddModifyLogic(Common.Logic.CurrentLogic);
-                    if (logicifon != null && logicifon.LogicId != 0)
-                    {
-                        Common.Logic.CurrentLogic.LogicId = logicifon.LogicId;
-                        Common.Logic.LogicList.Add(Common.Logic.CurrentLogic);
-                        if (tag)
-                        {
-                            Send.Zj(tag, Common.Logic.CurrentLogic);
-                        }
-                    }
-                }
-                else
-                {
-                    //鍙戦�佷慨鏀归�昏緫鍛戒护
-                    Send.AddModifyLogic(Common.Logic.CurrentLogic);
-                }
-
-                CommonPage.Loading.Hide();
-                UserView.HomePage.Instance.RemoveViewByTag("Logic");
-                Category.Category.instance?.RefreshBodyView();
-                //UserView.HomePage.Instance.RemoveAt("Logic1");
-                //Category.Category category = new Category.Category();
-                //UserView.HomePage.Instance.AddChidren(category);
-                //UserView.HomePage.Instance.PageIndex += 1;
-                //category.Show(2);
+                Method.SaveLogic(LogicView.IfString._Logic, name, LogicView.IfString.Tag, Common.Logic.CurrentLogic);
             };
-
-
-        }
-        /// <summary>
-        /// 鏇存柊鎵ц鍛ㄦ湡鐨勬柟娉�
-        /// </summary>
-        /// <param name="btndisplaycycle">Btndisplaycycle.</param>
-        void UpdateWeek(Button btndisplaycycle)
-        {
-
-            switch (Common.Logic.CurrentLogic.TimeAttribute.Repeat)
-            {
-                ///0:鍙墽琛屼竴娆★紝鎵ц鍚嶪sEnable鍊肩疆;1,浠婂勾鍐呮墽琛�;2锛氭瘡澶╂墽琛�;3锛氭瘡鏈堟墽琛�;4锛氭瘡骞存墽琛�;5锛氬懆閲嶅銆�
-                case 0:
-                    {
-                        btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.executeonce);
-                    }; break;
-                case 1: { }; break;
-                case 2:
-                    {
-                        btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.everyday);
-                    }; break;
-                case 3:
-                    {
-
-                        string len = "", value = "";
-                        var stringvalue = Convert.ToString(Common.Logic.CurrentLogic.TimeAttribute.MonthDate, 2);
-                        var str = stringvalue.Insert(0, new string('0', 32 - stringvalue.Length));
-                        for (int j = 31; j >= 0; j--)
-                        {
-                            len += str.Substring(j, 1);
-                        }
-                        for (int j = 0; j < len.Length; j++)
-                        {
-                            var strvalue = len.Substring(j, 1);
-                            if (strvalue == "1")
-                            {
-                                value += (j + 1).ToString() + ",";
-                            }
-                        }
-                        btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.monthly) + value.TrimEnd(',') + Language.StringByID(MyInternationalizationString.day);
-
-                    }; break;
-                case 4:
-                    {
-
-                        Dictionary<int, int> dictionary = new Dictionary<int, int>();
-                        ///鎵惧嚭鎵ц鐨勬湀浠藉拰澶╂暟
-                        if (Common.Logic.CurrentLogic.TimeAttribute.SelectMonDate.Count != 0)
-                        {
-                            for (int i = 0; i < Common.Logic.CurrentLogic.TimeAttribute.SelectMonDate.Count; i++)
-                            {
-                                var dayvalue = Common.Logic.CurrentLogic.TimeAttribute.SelectMonDate[i];
-                                if (dayvalue != 0)
-                                {
-                                    dictionary.Add(i + 1, dayvalue);
-                                }
-                            }
-                        }
-                        if (dictionary.Count != 0 && dictionary.Count == 1)
-                        {
-                            string len = "", leng = "";
-                            int minvalue = 0, Maximum = 0;
-                            foreach (var value in dictionary)
-                            {
-                                ///鍙栧嚭鏈堜唤
-                                var month = value.Key;
-                                ///鍙栧嚭鏃ユ暟
-                                var day = value.Value;
-                                var maxvalue = Convert.ToString(day, 2);
-                                var str = maxvalue.Insert(0, new string('0', 32 - maxvalue.Length));
-                                for (int j = 31; j >= 0; j--)
-                                {
-                                    len += str.Substring(j, 1);
-                                }
-
-                                for (int j = 0; j < len.Length; j++)
-                                {
-                                    var strvalue = len.Substring(j, 1);
-                                    if (strvalue == "1")
-                                    {
-                                        minvalue = j + 1;
-                                        break;
-                                    }
-                                }
-                                for (int j = 0; j < len.Length; j++)
-                                {
-                                    var strvalue = len.Substring(j, 1);
-                                    if (strvalue == "1")
-                                    {
-                                        Maximum = j + 1;
-                                    }
-                                }
-
-                                if (month.ToString().Length < 2)
-                                {
-                                    leng = "0" + month.ToString();
-                                }
-                                else
-                                {
-                                    leng = month.ToString();
-                                }
-                                if (minvalue == Maximum)
-                                {
-                                    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.everyyear) + leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString());
-                                }
-                                else
-                                {
-                                    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.everyyear) + leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString()) + "-" + leng + "/" + (Maximum.ToString().Length < 2 ? "0" + Maximum.ToString() : Maximum.ToString());
-                                }
-                            }
-
-                        }
-                        else
-                        {
-                            int b = 0;
-                            string stringtext = "";
-                            foreach (var value in dictionary)
-                            {
-                                string len = "", leng = "";
-                                int minvalue = 0, Maximum = 0;
-                                ///鍙栧嚭鏈堜唤
-                                var month = value.Key;
-                                ///鍙栧嚭鏃ユ暟
-                                var day = value.Value;
-                                var maxvalue = Convert.ToString(day, 2);
-                                var str = maxvalue.Insert(0, new string('0', 32 - maxvalue.Length));
-                                for (int j = 31; j >= 0; j--)
-                                {
-                                    len += str.Substring(j, 1);
-                                }
-
-
-                                if (month.ToString().Length < 2)
-                                {
-                                    leng = "0" + month.ToString();
-                                }
-                                else
-                                {
-                                    leng = month.ToString();
-                                }
-
-
-
-                                if (b == 0)
-                                {
-                                    for (int j = 0; j < len.Length; j++)
-                                    {
-                                        var strvalue = len.Substring(j, 1);
-                                        if (strvalue == "1")
-                                        {
-                                            minvalue = j + 1;
-                                            break;
-                                        }
-                                    }
-                                    stringtext += leng + "/" + (minvalue.ToString().Length < 2 ? "0" + minvalue.ToString() : minvalue.ToString()) + "-";
-
-                                }
-
-                                if (b == dictionary.Count - 1)
-                                {
-                                    for (int j = 0; j < len.Length; j++)
-                                    {
-                                        var strvalue = len.Substring(j, 1);
-                                        if (strvalue == "1")
-                                        {
-                                            Maximum = j + 1;
-                                        }
-                                    }
-                                    stringtext += leng + "/" + (Maximum.ToString().Length < 2 ? "0" + Maximum.ToString() : Maximum.ToString());
-
-                                }
-                                b++;
-                            }
-                            btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.everyyear) + stringtext;
-                        }
-
-                    }; break;
-                case 5:
-                    {
-                        string len = "", text = "";
-                        List<int> listvalueInt = new List<int>();
-                        listvalueInt.Clear();
-                        var maxvalue = Convert.ToString(Common.Logic.CurrentLogic.TimeAttribute.WeekDay, 2);
-                        var str = maxvalue.Insert(0, new string('0', 8 - maxvalue.Length));
-                        for (int j = 7; j >= 0; j--)
-                        {
-                            len += str.Substring(j, 1);
-                        }
-
-                        for (int j = 0; j < len.Length; j++)
-                        {
-                            var strvalue = len.Substring(j, 1);
-                            if (strvalue == "1")
-                            {
-                                listvalueInt.Add(j + 1);
-
-
-                                if ((j + 1) == 1)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.mon1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.mon) + ",";
-                                }
-                                else if ((j + 1) == 2)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.tue1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.tue) + ",";
-                                }
-                                else if ((j + 1) == 3)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.wed1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.wed) + ",";
-                                }
-                                else if ((j + 1) == 4)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.thu1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.thu) + ",";
-                                }
-                                else if ((j + 1) == 5)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.frl1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.frl) + ",";
-                                }
-                                else if ((j + 1) == 6)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.sat1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.sat) + ",";
-                                }
-                                else if ((j + 1) == 7)
-                                {
-                                    text += Language.StringByID(MyInternationalizationString.week1) + Language.StringByID(MyInternationalizationString.sun1) + ",";
-                                    //text += Language.StringByID(MyInternationalizationString.sun) + ",";
-                                }
-
-
-                            }
-                        }
-                        //鏆傛椂闅愯棌鎺夛紝闇�瑕佹樉绀哄懆鏈拰宸ヤ綔鏃ュ啀鏀惧紑锛�
-                        //if (listvalueInt.Count == 5 && !listvalueInt.Contains(6) && !listvalueInt.Contains(7))
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.workingday);
-                        //}
-                        //else if (listvalueInt.Count == 2 && listvalueInt.Contains(6) && listvalueInt.Contains(7))
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.weekend);
-                        //}
-                        //else if (listvalueInt.Count == 7)
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.everyday);
-                        //}
-                        //else
-                        //{
-                        //    btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.week1) + text.Replace(Language.StringByID(MyInternationalizationString.week1), "").TrimEnd(',');
-                        //}
-                        btndisplaycycle.Text = Language.StringByID(MyInternationalizationString.week1) + text.Replace(Language.StringByID(MyInternationalizationString.week1), "").TrimEnd(',');
-                        //btndisplaycycle.Text = text.TrimEnd(',');
-                    }; break;
-            }
-
 
         }
 
         void ConditionView(bool edit)
         {
             Common.Logic.CurrentLogic.LogicName = logicTextBox.Text.Trim();
-
-            #region 缁勫悎鏉′欢View
-            FrameLayout flMain = new FrameLayout { BackgroundColor = 0x50000000 };
+            #region  ------缁勫悎鏉′欢鐣岄潰甯冨眬閮ㄥ垎   
+            var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor };
             this.AddChidren(flMain);
-            flMain.MouseUpEventHandler += (sender2, e2) =>
+            CompleteView completeView = new CompleteView();
+            flMain.AddChidren(completeView.Show(2));
+            completeView.Btntitle.TextID = MyInternationalizationString.condition;
+            EventHandler<MouseEventArgs> clickcancel = (sender, e) =>
             {
-                flMain.RemoveFromParent();
-            };
-
-            var timetypeframelayout1 = new FrameLayout
-            {
-                Width = Application.GetRealWidth(1080),
-                Height = Application.GetRealHeight(100),
-                Y = Application.GetRealHeight(1920 - 100),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-            };
-            flMain.AddChidren(timetypeframelayout1);
-            var framelayout = new FrameLayout
-            {
-                Width = Application.GetRealWidth(1080),
-                Height = Application.GetRealHeight(530),
-                Y = Application.GetRealHeight(1920 - 530),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                Radius = (uint)Application.GetRealHeight(60),
-            };
-            flMain.AddChidren(framelayout);
-
-            #region  -------鍙栨秷   瀹屾垚
-            var timetype = new RowLayout
-            {
-                Height = Application.GetRealHeight(140),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            framelayout.AddChidren(timetype);
-            var Btncancel = new Button
-            {
-                TextID = MyInternationalizationString.cancel,
-                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                X = Application.GetRealWidth(80),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextSize = 14,
-            };
-            timetype.AddChidren(Btncancel);
-            Btncancel.MouseUpEventHandler += (sender16, e16) =>
-            {
-                flMain.RemoveFromParent();
                 UserView.HomePage.Instance.ScrollEnabled = true;
+                flMain.RemoveFromParent();
             };
+            flMain.MouseUpEventHandler += clickcancel;
+            completeView.Btncancel.MouseUpEventHandler += clickcancel;
 
-            var Btntitle = new Button
-            {
-                TextID = MyInternationalizationString.condition,
-                TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(320),
-                TextAlignment = TextAlignment.Center,
-                X = Btncancel.Right + Application.GetRealWidth(100),
-                TextSize = 16,
-            };
-            timetype.AddChidren(Btntitle);
-            var Btncomplete = new Button
-            {
-                TextID = MyInternationalizationString.complete,
-                TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                TextAlignment = TextAlignment.CenterRight,
-                X = Btntitle.Right + Application.GetRealWidth(100),
-                TextSize = 14,
-
-            };
-            timetype.AddChidren(Btncomplete);
+            //婊¤冻鎵�鏈夋潯浠�
+            mFunView allFunView = new mFunView();
+            allFunView.frameLayout.Y = Application.GetRealHeight(140 + 20);
+            completeView.Show(2).AddChidren(allFunView.Show());
+            allFunView.titleBtn.TextID = MyInternationalizationString.Allconditions;
+            //婊¤冻鍏朵腑涓�涓潯浠�
+            mFunView ormFunview = new mFunView();
+            ormFunview.frameLayout.Y = allFunView.frameLayout.Bottom;
+            completeView.Show(2).AddChidren(ormFunview.Show());
+            ormFunview.titleBtn.TextID = MyInternationalizationString.anycondition;
+            ormFunview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
             #endregion
 
-            #region  -------婊¤冻鎵�鏈夋潯浠�   婊¤冻鍏朵腑涓�涓潯浠�
-
-
-            #region  -------婊¤冻鎵�鏈夋潯浠�
-
-
-            var andFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = timetype.Bottom + Application.GetRealHeight(20),
-            };
-            framelayout.AddChidren(andFrameLayout);
-
-
-            var androw = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            andFrameLayout.AddChidren(androw);
-            var andbtn = new Button
-            {
-
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.Allconditions,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                TextSize = 14,
-
-            };
-            androw.AddChidren(andbtn);
-
-            var andSelected = new SelectedButton();
-            androw.AddChidren(andSelected);
-            #endregion
-            #region  -------婊¤冻鍏朵腑涓�涓潯浠�
-
-            var orFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = andFrameLayout.Bottom,
-
-            };
-            framelayout.AddChidren(orFrameLayout);
-
-
-
-            var orrow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-            };
-            orFrameLayout.AddChidren(orrow);
-            var orbtn = new Button
-            {
-
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.anycondition,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                TextSize = 14,
-            };
-            orrow.AddChidren(orbtn);
-
-            var orSelected = new SelectedButton();
-            orrow.AddChidren(orSelected);
-            #endregion
             ///婊¤冻鎵�鏈夋潯浠剁偣鍑讳簨浠�
-            EventHandler<MouseEventArgs> andclick = (sedner14, e14) =>
+            allFunView.clickviewBtn.MouseUpEventHandler += (sedner, e) =>
             {
-                andSelected.Visible = true;
-                orSelected.Visible = false;
-                andbtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                orbtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                allFunView.selectedIconBtn.Visible = true;
+                ormFunview.selectedIconBtn.Visible = false;
+                allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
             };
-            androw.MouseUpEventHandler += andclick;
-            andbtn.MouseUpEventHandler += andclick;
-            andSelected.MouseUpEventHandler += andclick;
-            andFrameLayout.MouseUpEventHandler += andclick;
-
-
             ///婊¤冻鍏朵腑涓�涓潯浠剁偣鍑讳簨浠�
-            EventHandler<MouseEventArgs> orclick = (sedner15, e15) =>
+            ormFunview.clickviewBtn.MouseUpEventHandler += (sedner, e) =>
             {
-                andSelected.Visible = false;
-                orSelected.Visible = true;
-                andbtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                orbtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                allFunView.selectedIconBtn.Visible = false;
+                ormFunview.selectedIconBtn.Visible = true;
+                allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
             };
-            orrow.MouseUpEventHandler += orclick;
-            orbtn.MouseUpEventHandler += orclick;
-            orSelected.MouseUpEventHandler += orclick;
-            orFrameLayout.MouseUpEventHandler += orclick;
-
-            #endregion
-            #endregion
 
             if (edit)
             {
                 if (Common.Logic.CurrentLogic.Relationship == 0)
                 {
-                    andSelected.Visible = true;
-                    orSelected.Visible = false;
-                    andbtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                    orbtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                    allFunView.selectedIconBtn.Visible = true;
+                    ormFunview.selectedIconBtn.Visible = false;
+                    allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                    ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
                 }
                 else
                 {
-                    andSelected.Visible = false;
-                    orSelected.Visible = true;
-                    andbtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                    orbtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                    allFunView.selectedIconBtn.Visible = false;
+                    ormFunview.selectedIconBtn.Visible = true;
+                    allFunView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                    ormFunview.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
                 }
             }
-            Btncomplete.MouseUpEventHandler += (sender, e) =>
+            completeView.Btncomplete.MouseUpEventHandler += (sender, e) =>
             {
-                if (!andSelected.Visible && !orSelected.Visible)
+                if (!allFunView.selectedIconBtn.Visible && !ormFunview.selectedIconBtn.Visible)
                 {
                     ///鍙互鎻愮ず鏈�変腑鐘舵�侊紱
                     return;
                 }
                 flMain.RemoveFromParent();
 
-                if (andSelected.Visible)
+                if (allFunView.selectedIconBtn.Visible)
                 {
                     Common.Logic.CurrentLogic.Relationship = 0;
 
                 }
-                if (orSelected.Visible)
+                if (ormFunview.selectedIconBtn.Visible)
                 {
                     Common.Logic.CurrentLogic.Relationship = 1;
 
                 }
-                var templateDeviceCondition = new TemplateDeviceCondition();
-                UserView.HomePage.Instance.AddChidren(templateDeviceCondition);
-                UserView.HomePage.Instance.PageIndex += 1;
-                templateDeviceCondition.Show();
+                if (edit)
+                {
+                    if (Common.Logic.CurrentLogic.LogicId != 0)
+                    {
+                        Send.LogicControlSwitch(Common.Logic.CurrentLogic);
+                    }
+
+                    var templatePage = new TemplatePage();
+                    UserView.HomePage.Instance.AddChidren(templatePage);
+                    UserView.HomePage.Instance.PageIndex += 1;
+                    templatePage.Show();
+                }
+                else
+                {
+                    var roomAndDeviceView = new RoomAndDeviceView();
+                    UserView.HomePage.Instance.AddChidren(roomAndDeviceView);
+                    UserView.HomePage.Instance.PageIndex += 1;
+                    roomAndDeviceView.IfType = "condition_mould";
+                    roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.addsensor));
+                }
             };
 
         }
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs
index dbf1f56..ef3652f 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/TimePage.cs
@@ -3,6 +3,7 @@
 using Shared;
 using Shared.Common;
 using Shared.Phone;
+using Shared.Phone.Device.Logic.LogicView;
 using Shared.R;
 using ZigBee.Device;
 
@@ -21,252 +22,54 @@
         public void Show()
         {
 
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.addtime,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent();
-            };
+            #region  涓婇潰鐨勫竷灞�浠g爜
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.TextID = MyInternationalizationString.selection;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             #endregion
-
-
-            
 
             #region  鏈�涓嬮潰鐨勫竷灞�浠g爜
             var middle = new FrameLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184-260),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
 
-            var fra = new FrameLayout
-            {
-                Y = middle.Bottom,
-                Height = Application.GetRealHeight(260),
-                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-            };
-            this.AddChidren(fra);
-            var btnsave = new Button
-            {
-                X = Application.GetRealWidth(85),
-                Height = Application.GetRealHeight(130),//194
-                Width = Application.GetRealWidth(910),
-                Radius = (uint)Application.GetRealHeight(60),
-                BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
-                TextID = MyInternationalizationString.Save,
-                TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
-                TextSize = 16,
-            };
-            fra.AddChidren(btnsave);
+            //淇濆瓨
+            SaveView saveView = new SaveView();
+            saveView.frameLayout.Y = middle.Bottom;
+            this.AddChidren(saveView.Show());
             #endregion
 
             #region   -----鏃堕棿鑼冨洿  寮�濮嬫椂闂�  缁撴潫鏃堕棿
             #region   -----鏃堕棿鑼冨洿
 
-
-            var typeFramelayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(typeFramelayout);
-
-
-            var typeRowlayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            typeFramelayout.AddChidren(typeRowlayout);
-
-            var btnTypeTextTitle = new Button
-            {
-                Text = Language.StringByID(MyInternationalizationString.type),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(265),
-                TextSize = 14,
-            };
-            typeRowlayout.AddChidren(btnTypeTextTitle);
-            
-            
-            var btnimmediateexecution = new Button
-            {
-                X = btnTypeTextTitle.Right,
-                Gravity = Gravity.CenterVertical,
-                Width = Application.GetRealWidth(630),
-                TextAlignment = TextAlignment.CenterRight,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextID = MyInternationalizationString.timeframe,
-                TextSize = 14,
-            };
-            typeRowlayout.AddChidren(btnimmediateexecution);
-
-
-            var btnimmediateexecutionBack = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = btnimmediateexecution.Right + Application.GetRealWidth(12),
-                Gravity = Gravity.CenterVertical,
-            };
-            typeRowlayout.AddChidren(btnimmediateexecutionBack);
-
+            TypeView typeView = new TypeView();
+            middle.AddChidren(typeView.Show());
+            typeView.textBtn.TextID = MyInternationalizationString.type;
+            typeView.titleBtn.TextID = MyInternationalizationString.timeframe;
 
             #endregion
 
             #region  -----寮�濮嬫椂闂�
-            var timestarFramelayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                Y= typeFramelayout.Bottom,
-            };
-            middle.AddChidren(timestarFramelayout);
 
-            var timestartrow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            timestarFramelayout.AddChidren(timestartrow);
-
-            var btnstarttimetext = new Button
-            {
-                Text = Language.StringByID(MyInternationalizationString.starttime),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(265),
-                TextSize = 14,
-
-            };
-            timestartrow.AddChidren(btnstarttimetext);
-
-            var btnstarttime = new Button
-            {
-                X = btnstarttimetext.Right,
-                Gravity = Gravity.CenterVertical,
-                Width = Application.GetRealWidth(630),
-                TextAlignment = TextAlignment.CenterRight,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Tag = "0",
-                TextSize = 14,
-            };
-            timestartrow.AddChidren(btnstarttime);
-
-            var btnstartback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = btnstarttime.Right + Application.GetRealWidth(12),
-                Gravity = Gravity.CenterVertical,
-            };
-            timestartrow.AddChidren(btnstartback);
-
+            TypeView startView = new TypeView();
+            startView.frameLayout.Y = typeView.frameLayout.Bottom;
+            middle.AddChidren(startView.Show());
+            startView.textBtn.TextID = MyInternationalizationString.starttime;
+            startView.titleBtn.Tag = "0";
             #endregion
 
             #region  -----缁撴潫鏃堕棿
-            var timeendFramelayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                Y = timestarFramelayout.Bottom,
-            };
-            middle.AddChidren(timeendFramelayout);
 
-            var timeendrow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            timeendFramelayout.AddChidren(timeendrow);
-            var btnendtimetext = new Button
-            {
-                Text = Language.StringByID(MyInternationalizationString.endtime),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(265),
-                TextSize = 14,
-
-            };
-            timeendrow.AddChidren(btnendtimetext);
-
-            var btnendtime = new Button
-            {
-                X = btnendtimetext.Right,
-                Gravity = Gravity.CenterVertical,
-                Width = Application.GetRealWidth(630),
-                TextAlignment = TextAlignment.CenterRight,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Tag = "0",
-                TextSize = 14,
-            };
-            timeendrow.AddChidren(btnendtime);
-
-            var btnendtimeback = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = btnendtime.Right + Application.GetRealWidth(12),
-                Gravity = Gravity.CenterVertical,
-            };
-            timeendrow.AddChidren(btnendtimeback);
+            TypeView endView = new TypeView();
+            endView.frameLayout.Y = startView.frameLayout.Bottom;
+            middle.AddChidren(endView.Show());
+            endView.textBtn.TextID = MyInternationalizationString.endtime;
+            endView.titleBtn.Tag = "0";
 
             #endregion
             #endregion
@@ -296,8 +99,8 @@
                     {
                         s2 = endtime[1];
                     }
-                    btnstarttime.Text = starttime[0] + ":" + s1;
-                    btnendtime.Text =endtime[0] + ":" + s2;
+                    startView.titleBtn.Text = starttime[0] + ":" + s1;
+                    endView.titleBtn.Text =endtime[0] + ":" + s2;
 
                     //btnstarttime.Text = timestr[0];
                     //btnendtime.Text = timestr[1];
@@ -321,12 +124,13 @@
                     timeBucketConditionsInfo.Add("StartMin", starttime[1]);
                     timeBucketConditionsInfo.Add("StopHour", endtime[0]);
                     timeBucketConditionsInfo.Add("StopMin", endtime[1]);
-                    btnstarttime.Tag = int.Parse(starttime[0]) * 60 + int.Parse(starttime[1]);
-                    btnendtime.Tag = int.Parse(endtime[0]) * 60 + int.Parse(endtime[1]);
+                    startView.titleBtn.Tag = int.Parse(starttime[0]) * 60 + int.Parse(starttime[1]);
+                    endView.titleBtn.Tag = int.Parse(endtime[0]) * 60 + int.Parse(endtime[1]);
                 }
 
             }
-            EventHandler<MouseEventArgs> stattimeclick = (sender, e) =>
+
+            startView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
 
                 var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor };
@@ -365,7 +169,7 @@
 
                     var startval = timeview.Hour * 60 + timeview.Minute;
 
-                    if (btnendtime.Tag.ToString() != "0" &&  startval.ToString()==btnendtime.Tag.ToString())
+                    if (endView.titleBtn.Tag.ToString() != "0" &&  startval.ToString()== endView.titleBtn.Tag.ToString())
                     {
                        
                         var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
@@ -374,7 +178,7 @@
                         alert.Show();
                         return;
                     }
-                    if (btnendtime.Tag.ToString() != "0" && startval > int.Parse(btnendtime.Tag.ToString()))
+                    if (endView.titleBtn.Tag.ToString() != "0" && startval > int.Parse(endView.titleBtn.Tag.ToString()))
                     {
              
                         var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
@@ -391,18 +195,14 @@
                     {
                         timeBucketConditionsInfo.Remove("StartMin");
                     }
-                    btnstarttime.Tag = timeview.Hour * 60 + timeview.Minute;
+                    startView.titleBtn.Tag = timeview.Hour * 60 + timeview.Minute;
                     timeBucketConditionsInfo.Add("StartHour", timeview.Hour.ToString());
                     timeBucketConditionsInfo.Add("StartMin", timeview.Minute.ToString());
-                    btnstarttime.Text = timeview.Hour.ToString() + ":" + (timeview.Minute.ToString().Length < 2?"0"+timeview.Minute.ToString():timeview.Minute.ToString());
+                    startView.titleBtn.Text = timeview.Hour.ToString() + ":" + (timeview.Minute.ToString().Length < 2?"0"+timeview.Minute.ToString():timeview.Minute.ToString());
                 };
             };
-            timestartrow.MouseUpEventHandler += stattimeclick;
-            btnstarttimetext.MouseUpEventHandler += stattimeclick;
-            btnstarttime.MouseUpEventHandler += stattimeclick;
-            btnstartback.MouseUpEventHandler += stattimeclick;
-            timestarFramelayout.MouseUpEventHandler += stattimeclick;
-            EventHandler<MouseEventArgs> endtimeclick = (sender, e) =>
+
+            endView.clickviewBtn.MouseUpEventHandler+= (sender, e) =>
             {
 
                 var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor };
@@ -441,7 +241,7 @@
 
                     var endval = timeview.Hour * 60 + timeview.Minute;
 
-                    if (btnstarttime.Tag.ToString() != "0" && endval.ToString() == btnstarttime.Tag.ToString())
+                    if (startView.titleBtn.Tag.ToString() != "0" && endval.ToString() == startView.titleBtn.Tag.ToString())
                     {
                        
                         var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
@@ -450,7 +250,7 @@
                         alert.Show();
                         return;
                     }
-                    if (btnstarttime.Tag.ToString() != "0" && endval < int.Parse(btnstarttime.Tag.ToString()))
+                    if (startView.titleBtn.Tag.ToString() != "0" && endval < int.Parse(startView.titleBtn.Tag.ToString()))
                     {
                        
                         var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
@@ -468,20 +268,16 @@
                     {
                         timeBucketConditionsInfo.Remove("StopMin");
                     }
-                    btnendtime.Tag = timeview.Hour * 60 + timeview.Minute;
+                    endView.titleBtn.Tag = timeview.Hour * 60 + timeview.Minute;
                     timeBucketConditionsInfo.Add("StopHour",timeview.Hour.ToString());
                     timeBucketConditionsInfo.Add("StopMin", timeview.Minute.ToString());
-                    btnendtime.Text = timeview.Hour.ToString() + ":" + (timeview.Minute.ToString().Length < 2?"0"+timeview.Minute.ToString():timeview.Minute.ToString());
+                    endView.titleBtn.Text = timeview.Hour.ToString() + ":" + (timeview.Minute.ToString().Length < 2?"0"+timeview.Minute.ToString():timeview.Minute.ToString());
                 };
             };
-            timeendrow.MouseUpEventHandler += endtimeclick;
-            btnendtimetext.MouseUpEventHandler += endtimeclick;
-            btnendtime.MouseUpEventHandler += endtimeclick;
-            btnendtimeback.MouseUpEventHandler += endtimeclick;
-            timeendFramelayout.MouseUpEventHandler += endtimeclick;
+          
 
             ///瀹屾垚鐐瑰嚮浜嬩欢
-            EventHandler<MouseEventArgs>completeclick=(sender, e) =>
+            saveView.clickviewBtn.MouseUpEventHandler+= (sender, e) =>
             {
                 if (timeBucketConditionsInfo.ContainsKey("Type"))
                 {
@@ -494,7 +290,7 @@
                 timeBucketConditionsInfo.Add("Type", "5");
                 timeBucketConditionsInfo.Add("IsValid", "1");
 
-                if (string.IsNullOrEmpty(btnstarttime.Text) || string.IsNullOrEmpty(btnendtime.Text))
+                if (string.IsNullOrEmpty(startView.titleBtn.Text) || string.IsNullOrEmpty(endView.titleBtn.Text))
                 {
                     var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
                                            Language.StringByID(MyInternationalizationString.completeNext),
@@ -502,7 +298,7 @@
                     alert.Show();
                     return;
                 }
-                if (btnstarttime.Text == btnendtime.Text)
+                if (startView.titleBtn.Text == endView.titleBtn.Text)
                 {
                     var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
                                            Language.StringByID(MyInternationalizationString.sametime),
@@ -541,8 +337,6 @@
                 UserView.HomePage.Instance.PageIndex += 1;
                 logicCommunalPage.Show(() => { });
             };
-            fra.MouseUpEventHandler += completeclick;
-            btnsave.MouseUpEventHandler += completeclick;
         }
 
     }
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/TimePoint.cs b/ZigbeeApp/Shared/Phone/Device/Logic/TimePoint.cs
index e55454c..8e1134d 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/TimePoint.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/TimePoint.cs
@@ -3,6 +3,7 @@
 using Shared;
 using Shared.Common;
 using Shared.Phone;
+using Shared.Phone.Device.Logic.LogicView;
 using Shared.R;
 using ZigBee.Device;
 namespace Shared.Phone.Device.Logic
@@ -13,8 +14,8 @@
         {
             Tag = "Logic";
         }
-       
-        Dictionary<string, string> timeifon=new Dictionary<string, string>();
+
+        Dictionary<string, string> timeifon = new Dictionary<string, string>();
         Button beforeClickButton = new Button();
         TimeView timeview = new TimeView
         {
@@ -44,22 +45,22 @@
         public string DateType;
         public void Show(Dictionary<string, string> dictionary)
         {
-            
+
             int TypeValue = int.Parse(dictionary["DateType"]);
-                timeifon.Add("Type", "0");
-                timeifon.Add("IsValid", "1");
-                timeifon.Add("RemindTime", "0");
-                timeifon.Add("EnDelay", "0");
-                timeifon.Add("DelayTime", "0");
-                timeifon.Add("DateType", TypeValue.ToString());
-                DateType = dictionary["DateType"];
-             
+            timeifon.Add("Type", "0");
+            timeifon.Add("IsValid", "1");
+            timeifon.Add("RemindTime", "0");
+            timeifon.Add("EnDelay", "0");
+            timeifon.Add("DelayTime", "0");
+            timeifon.Add("DateType", TypeValue.ToString());
+            DateType = dictionary["DateType"];
+
             if (TypeValue == 0)
             {
                 timeifon.Add("StartHour", dictionary["StartHour"]);
                 timeifon.Add("StartMin", dictionary["StartMin"]);
                 StartHour = dictionary["StartHour"];
-                StartMin= dictionary["StartMin"];
+                StartMin = dictionary["StartMin"];
             }
             else
             {
@@ -68,68 +69,23 @@
 
             }
 
-
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.addtime,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent();
-            };
+            #region  涓婇潰鐨勫竷灞�浠g爜
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.TextID = MyInternationalizationString.addtime;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             #endregion
 
 
             var middle = new FrameLayout
             {
-                Y = topRowLayout.Bottom,
-                Height = Application.GetRealHeight(1920 - 184-260),
+                Y = view.topRowLayout.Bottom,
+                Height = Application.GetRealHeight(1920 - 184 - 260),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
+            SelectedTimeTypeView(middle, TypeValue);
 
-            SelectedTimeTypeView(middle,TypeValue);
-      
 
         }
         /// <summary>
@@ -140,133 +96,20 @@
         void SelectedTimeTypeView(FrameLayout middle, int TypeValue)
         {
             middle.RemoveAll();
-            #region   -----绔嬪嵆鎵ц
+            #region   -----绔嬪嵆鎵ц 鏃跺埢
+            TypeView typeView = new TypeView();
+            middle.AddChidren(typeView.Show());
+            typeView.textBtn.TextID = MyInternationalizationString.type;
+            typeView.titleBtn.TextID = MyInternationalizationString.immediateexecution;
             
-
-            var typeFramelayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            middle.AddChidren(typeFramelayout);
-
-
-            var typeRowlayout = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            typeFramelayout.AddChidren(typeRowlayout);
-
-            var btnTypeTextTitle = new Button
-            {
-                Text = Language.StringByID(MyInternationalizationString.type),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width = Application.GetRealWidth(265),
-                TextSize = 14,
-            };
-            typeRowlayout.AddChidren(btnTypeTextTitle);
-
-
-            ///鏄剧ず鏃堕棿绫诲瀷鐨勬帶浠�
-            var btnimmediateexecution = new Button
-            {
-                X = btnTypeTextTitle.Right,
-                Gravity = Gravity.CenterVertical,
-                Width = Application.GetRealWidth(630),
-                TextAlignment = TextAlignment.CenterRight,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextID=MyInternationalizationString.immediateexecution,
-                TextSize = 14,
-            };
-            typeRowlayout.AddChidren(btnimmediateexecution);
-
-
-            var btnimmediateexecutionBack = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = btnimmediateexecution.Right + Application.GetRealWidth(12),
-                Gravity = Gravity.CenterVertical,
-            };
-            typeRowlayout.AddChidren(btnimmediateexecutionBack);
-                                  
-            #endregion
-
-            #region   -----鏃跺埢
-            
-
-            var timetypeFramelayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                Y= typeFramelayout.Bottom,
-            };
-            middle.AddChidren(timetypeFramelayout);
-                       
-
-            var rowSelectedTimeType = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(965),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(58),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-
-            };
-            timetypeFramelayout.AddChidren(rowSelectedTimeType);
-
-            var btnTimeText = new Button
-            {
-                Text = Language.StringByID(MyInternationalizationString.moment),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                Width=Application.GetRealWidth(265),
-                TextSize = 14,
-            };
-            rowSelectedTimeType.AddChidren(btnTimeText);
-            
-
-            ///鏄剧ず鏃堕棿绫诲瀷鐨勬帶浠�
-            var btnTimeTpye = new Button
-            {
-                X = btnTimeText.Right,
-                Gravity = Gravity.CenterVertical,
-                Width = Application.GetRealWidth(630),
-                TextAlignment = TextAlignment.CenterRight,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextSize = 14,
-            };
-            rowSelectedTimeType.AddChidren(btnTimeTpye);
-
-
-            var btnTimeTpyeBack = new Button
-            {
-                Width = Application.GetRealWidth(58),
-                Height = Application.GetRealHeight(58),
-                UnSelectedImagePath = "ZigeeLogic/next.png",
-                X = btnTimeTpye.Right+ Application.GetRealWidth(12),
-                Gravity = Gravity.CenterVertical,
-            };
-            rowSelectedTimeType.AddChidren(btnTimeTpyeBack);
-                      
-                       
-
-            EventHandler<MouseEventArgs> timetpyeclick = (sedner, e) =>
-            {
+            TypeView timeView = new TypeView();
+            timeView.frameLayout.Y = typeView.frameLayout.Bottom;
+            middle.AddChidren(timeView.Show());
+            timeView.textBtn.TextID = MyInternationalizationString.moment;
+            timeView.clickviewBtn.MouseUpEventHandler += (sender, e) => {
                 TimeTypeView(middle, TypeValue);
-            };
-            rowSelectedTimeType.MouseUpEventHandler += timetpyeclick;
-            btnTimeText.MouseUpEventHandler += timetpyeclick;
-            btnTimeTpye.MouseUpEventHandler += timetpyeclick;
-            btnTimeTpyeBack.MouseUpEventHandler += timetpyeclick;
-            timetypeFramelayout.MouseUpEventHandler += timetpyeclick;
 
+            };
             #endregion
 
             string textvalue = "";
@@ -274,13 +117,13 @@
             {
                 case 0:
                     {
-                        btnTimeTpye.Text = Language.StringByID(MyInternationalizationString.logiccustom);
+                        timeView.titleBtn.Text = Language.StringByID(MyInternationalizationString.logiccustom);
                         textvalue = timeifon["StartHour"] + ":" + timeifon["StartMin"];
                     }
                     break;
                 case 1:
                     {
-                        btnTimeTpye.Text = Language.StringByID(MyInternationalizationString.sunrise);
+                        timeView.titleBtn.Text = Language.StringByID(MyInternationalizationString.sunrise);
                         if (int.Parse(timeifon["AdjustTime"]) > 0)
                         {
                             textvalue = Language.StringByID(MyInternationalizationString.delayed) + timeifon["AdjustTime"] + Language.StringByID(MyInternationalizationString.logicminute);
@@ -291,13 +134,13 @@
                         }
                         else
                         {
-                            textvalue =Language.StringByID(MyInternationalizationString.nothing);
+                            textvalue = Language.StringByID(MyInternationalizationString.nothing);
                         }
                     }
                     break;
                 case 2:
                     {
-                        btnTimeTpye.Text = Language.StringByID(MyInternationalizationString.sunset);
+                        timeView.titleBtn.Text = Language.StringByID(MyInternationalizationString.sunset);
                         if (int.Parse(timeifon["AdjustTime"]) > 0)
                         {
                             textvalue = Language.StringByID(MyInternationalizationString.delayed) + timeifon["AdjustTime"] + Language.StringByID(MyInternationalizationString.logicminute);
@@ -308,13 +151,13 @@
                         }
                         else
                         {
-                            textvalue =Language.StringByID(MyInternationalizationString.nothing);
+                            textvalue = Language.StringByID(MyInternationalizationString.nothing);
                         }
                     }
                     break;
                 case 3:
                     {
-                        btnTimeTpye.Text = Language.StringByID(MyInternationalizationString.noon);
+                        timeView.titleBtn.Text = Language.StringByID(MyInternationalizationString.noon);
                         if (int.Parse(timeifon["AdjustTime"]) > 0)
                         {
                             textvalue = Language.StringByID(MyInternationalizationString.delayed) + timeifon["AdjustTime"] + Language.StringByID(MyInternationalizationString.logicminute);
@@ -330,19 +173,18 @@
                     }
                     break;
             }
-
             if (TypeValue == 0)
             {
 
                 #region   -----鑷畾涔夋椂闂�
-                rowSelectedTimeType.LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
-                btnTimeTpyeBack.UnSelectedImagePath = "ZigeeLogic/dropdown.png";
+                typeView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
+                timeView.backBtn.UnSelectedImagePath = "ZigeeLogic/dropdown.png";
                 var linebtn = new Button
                 {
-                    Y = timetypeFramelayout.Bottom,
+                    Y = timeView.frameLayout.Bottom,
                     Height = Application.GetRealHeight(5),
                     BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                    X=Application.GetRealWidth(58),
+                    X = Application.GetRealWidth(58),
                     Width = Application.GetRealWidth(965),
                 };
                 middle.AddChidren(linebtn);
@@ -360,66 +202,13 @@
             {
 
                 #region   -----鎻愬墠/寤舵椂
-                                
-                var delayFramelayout = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(160),
-                    BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    Y = timetypeFramelayout.Bottom,
-                };
-                middle.AddChidren(delayFramelayout);
 
-
-                var rowDelayType = new RowLayout
-                {
-                    Y = Application.GetRealHeight(30),
-                    Width = Application.GetRealWidth(965),
-                    Height = Application.GetRealHeight(130),
-                    X = Application.GetRealWidth(58),
-                    LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                };
-                delayFramelayout.AddChidren(rowDelayType);
-
-                var btnDelayTimeText = new Button
-                {
-                    Text = Language.StringByID(MyInternationalizationString.Advancedelay),
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    Width = Application.GetRealWidth(265),
-                    TextSize = 14,
-                };
-                rowDelayType.AddChidren(btnDelayTimeText);
-
-
-                ///鏄剧ず鏃堕棿绫诲瀷鐨勬帶浠�
-                var btnDelayTime = new Button
-                {
-                    X = btnTimeText.Right,
-                    Gravity = Gravity.CenterVertical,
-                    Width = Application.GetRealWidth(630),
-                    TextAlignment = TextAlignment.CenterRight,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    Text = textvalue,
-                    TextSize = 14,
-                };
-                rowDelayType.AddChidren(btnDelayTime);
-
-
-                var btnDelayTimeBack = new Button
-                {
-                    Width = Application.GetRealWidth(58),
-                    Height = Application.GetRealHeight(58),
-                    UnSelectedImagePath = "ZigeeLogic/next.png",
-                    X = btnTimeTpye.Right + Application.GetRealWidth(12),
-                    Gravity = Gravity.CenterVertical,
-                };
-                rowDelayType.AddChidren(btnDelayTimeBack);
-
-
-
-                EventHandler<MouseEventArgs> timeclick = (sedner, e) =>
-                {
-
+                TypeView delayView = new TypeView();
+                delayView.frameLayout.Y = timeView.frameLayout.Bottom;
+                middle.AddChidren(delayView.Show());
+                delayView.textBtn.TextID = MyInternationalizationString.Advancedelay;
+                delayView.titleBtn.Text = textvalue;
+                delayView.clickviewBtn.MouseUpEventHandler += (sender, e) => {
                     var mList = new List<string>();
                     mList.Add(Language.StringByID(MyInternationalizationString.advance));
                     mList.Add(Language.StringByID(MyInternationalizationString.nothing));
@@ -498,36 +287,14 @@
                     }, selectIndex, timevalue - 1, Language.StringByID(MyInternationalizationString.Advancedelay));
 
                 };
-                delayFramelayout.MouseUpEventHandler += timeclick;
-                rowDelayType.MouseUpEventHandler += timeclick;
-                btnDelayTimeText.MouseUpEventHandler += timeclick;
-                btnDelayTime.MouseUpEventHandler += timeclick;
-                btnDelayTimeBack.MouseUpEventHandler += timeclick;
 
                 #endregion
             }
-
-
-            var fra = new FrameLayout
-            {
-                Y = middle.Bottom,
-                Height = Application.GetRealHeight(260),
-                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-            };
-           this.AddChidren(fra);
-            var btnsave = new Button
-            {
-                X = Application.GetRealWidth(85),
-                Height = Application.GetRealHeight(130),//194
-                Width = Application.GetRealWidth(910),
-                Radius = (uint)Application.GetRealHeight(60),
-                BackgroundColor =ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
-                TextID = MyInternationalizationString.Save,
-                TextColor= ZigbeeColor.Current.LogicBtnSaveTextColor,
-                TextSize = 16,
-            };
-            fra.AddChidren(btnsave);
-            btnsave.MouseUpEventHandler += (sender, e) =>
+            //淇濆瓨
+            SaveView saveView = new SaveView();
+            saveView.frameLayout.Y = middle.Bottom;
+            this.AddChidren(saveView.Show());
+            saveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
                 if (TypeValue == 0)
                 {
@@ -595,269 +362,91 @@
             UserView.HomePage.Instance.ScrollEnabled = false;
             var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor };
             this.AddChidren(flMain);
-            flMain.MouseUpEventHandler += (sender12, e12) =>
-            {
-                UserView.HomePage.Instance.ScrollEnabled = true;
-                flMain.RemoveFromParent();
-            };
-
-           
-            var fraview = new FrameLayout
-            {
-                Width = Application.GetRealWidth(1080),
-                Height = Application.GetRealHeight(850),
-                Y = Application.GetRealHeight(1920 - 850),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                //Radius = (uint)Application.GetRealHeight(60),
-            };
-            flMain.AddChidren(fraview);
-            fraview.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
-
             #region  -------鍙栨秷   瀹屾垚
-            var timetype = new RowLayout
+            CompleteView completeView = new CompleteView();
+            flMain.AddChidren(completeView.Show(4));
+            completeView.Btntitle.TextID = MyInternationalizationString.type;
+            EventHandler<MouseEventArgs> clickcancel = (sender, e) =>
             {
-                Height = Application.GetRealHeight(140),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            fraview.AddChidren(timetype);
-            var Btncancel = new Button
-            {
-                TextID = MyInternationalizationString.cancel,
-                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                X = Application.GetRealWidth(80),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextSize = 14,
-            };
-            timetype.AddChidren(Btncancel);
-            Btncancel.MouseUpEventHandler += (sender16, e16) =>
-            {
-                flMain.RemoveFromParent();
                 UserView.HomePage.Instance.ScrollEnabled = true;
+                flMain.RemoveFromParent();
             };
+            flMain.MouseUpEventHandler += clickcancel;
+            completeView.Btncancel.MouseUpEventHandler += clickcancel;
 
-            var Btntitle = new Button
-            {
-                TextID = MyInternationalizationString.type,
-                TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(320),
-                TextAlignment = TextAlignment.Center,
-                X = Btncancel.Right + Application.GetRealWidth(100),
-                TextSize = 16,
-            };
-            timetype.AddChidren(Btntitle);
-            var Btncomplete = new Button
-            {
-                TextID = MyInternationalizationString.complete,
-                TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                TextAlignment = TextAlignment.CenterRight,
-                X = Btntitle.Right + Application.GetRealWidth(100),
-                TextSize = 14,
-
-            };
-            timetype.AddChidren(Btncomplete);
             #endregion
             #region  -------鏃ュ嚭锛屾棩钀斤紝姝e崍锛岃嚜瀹氫箟
-            #region 鏃ュ嚭
+            // 鏃ュ嚭
+            mFunView sunriseView = new mFunView();
+            sunriseView.frameLayout.Y = Application.GetRealHeight(140 + 20);
+            completeView.Show(4).AddChidren(sunriseView.Show());
+            sunriseView.titleBtn.TextID = MyInternationalizationString.sunrise;
 
+            //鏃ヨ惤
+            mFunView sunsetView = new mFunView();
+            sunsetView.frameLayout.Y = sunriseView.frameLayout.Bottom;
+            completeView.Show(4).AddChidren(sunsetView.Show());
+            sunsetView.titleBtn.TextID = MyInternationalizationString.sunset;
 
-            var sunriseFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = timetype.Bottom + Application.GetRealHeight(50),
-            };
-            fraview.AddChidren(sunriseFrameLayout);
+           //姝e崍
+            mFunView noonView = new mFunView();
+            noonView.frameLayout.Y = sunsetView.frameLayout.Bottom;
+            completeView.Show(4).AddChidren(noonView.Show());
+            noonView.titleBtn.TextID = MyInternationalizationString.noon;
 
-            var sunriseRow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            sunriseFrameLayout.AddChidren(sunriseRow);
+            //鑷畾涔�
+            mFunView customView = new mFunView();
+            customView.frameLayout.Y = noonView.frameLayout.Bottom;
+            completeView.Show(4).AddChidren(customView.Show());
+            customView.titleBtn.TextID = MyInternationalizationString.logiccustom;
+            customView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
 
-            var btnsunrisetext = new Button
-            {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.sunrise,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                TextSize = 14,
-            };
-            sunriseRow.AddChidren(btnsunrisetext);
-
-            var sunriseSelected = new SelectedButton();
-            sunriseRow.AddChidren(sunriseSelected);
-            #endregion
-            #region 鏃ヨ惤
-
-
-
-            var sunsetFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = sunriseFrameLayout.Bottom,
-            };
-            fraview.AddChidren(sunsetFrameLayout);
-
-            var sunsetRow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            sunsetFrameLayout.AddChidren(sunsetRow);
-
-            var btnsunsettext = new Button
-            {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.sunset,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                TextSize = 14,
-            };
-            sunsetRow.AddChidren(btnsunsettext);
-
-            var sunsetSelected = new SelectedButton();
-            sunsetRow.AddChidren(sunsetSelected);
-            #endregion
-
-            #region 姝e崍
-            //姝e崍
-
-
-
-            var noonFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = sunsetFrameLayout.Bottom,
-            };
-            fraview.AddChidren(noonFrameLayout);
-
-            var noonRow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            noonFrameLayout.AddChidren(noonRow);
-
-            var btnnoontext = new Button
-            {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.noon,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                TextSize = 14,
-            };
-            noonRow.AddChidren(btnnoontext);
-
-            var noonSelected = new SelectedButton();
-            noonRow.AddChidren(noonSelected);
-
-            #endregion
-            #region 鑷畾涔�
-
-            var logiccustomFrameLayout = new FrameLayout
-            {
-                Height = Application.GetRealHeight(160),
-                Y = noonFrameLayout.Bottom,
-            };
-            fraview.AddChidren(logiccustomFrameLayout);
-
-            var logiccustomRow = new RowLayout
-            {
-                Y = Application.GetRealHeight(30),
-                Width = Application.GetRealWidth(920),
-                Height = Application.GetRealHeight(130),
-                X = Application.GetRealWidth(80),
-                LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-            };
-            logiccustomFrameLayout.AddChidren(logiccustomRow);
-
-            var btnlogiccustomtext = new Button
-            {
-                Width = Application.GetRealWidth(600),
-                TextID = MyInternationalizationString.logiccustom,
-                TextAlignment = TextAlignment.CenterLeft,
-                TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                TextSize = 14,
-            };
-            logiccustomRow.AddChidren(btnlogiccustomtext);
-
-            var logiccustomSelected = new SelectedButton();
-            logiccustomRow.AddChidren(logiccustomSelected);
-            #endregion
             int value = -1;
-            EventHandler<MouseEventArgs> sunriseclick = (sender,e) => {
-                btnsunrisetext.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                btnsunsettext.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnnoontext.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnlogiccustomtext.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                sunriseSelected.Visible = true;
-                sunsetSelected.Visible = false;
-                noonSelected.Visible = false;
-                logiccustomSelected.Visible = false;
+            sunriseView.clickviewBtn.MouseUpEventHandler += (sender, e) => {
+                sunriseView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                sunsetView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                noonView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                customView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                sunriseView.selectedIconBtn.Visible = true;
+                sunsetView.selectedIconBtn.Visible = false;
+                noonView.selectedIconBtn.Visible = false;
+                customView.selectedIconBtn.Visible = false;
                 value = 1;
             };
-            sunriseFrameLayout.MouseUpEventHandler += sunriseclick;
-            sunriseRow.MouseUpEventHandler += sunriseclick;
-            btnsunrisetext.MouseUpEventHandler += sunriseclick;
-            sunriseSelected.MouseUpEventHandler += sunriseclick;
-
-            EventHandler<MouseEventArgs> sunsetclick = (sender, e) => {
-                btnsunrisetext.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnsunsettext.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                btnnoontext.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnlogiccustomtext.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                sunriseSelected.Visible = false;
-                sunsetSelected.Visible = true;
-                noonSelected.Visible = false;
-                logiccustomSelected.Visible = false;
-                value = 2;
-            };
-            sunsetFrameLayout.MouseUpEventHandler += sunsetclick;
-            sunsetRow.MouseUpEventHandler += sunsetclick;
-            btnsunsettext.MouseUpEventHandler += sunsetclick;
-            sunsetSelected.MouseUpEventHandler += sunsetclick;
-
-            EventHandler<MouseEventArgs> noonclick = (sender, e) =>
+            sunsetView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+             {
+                 sunriseView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                 sunsetView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                 noonView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                 customView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                 sunriseView.selectedIconBtn.Visible = false;
+                 sunsetView.selectedIconBtn.Visible = true;
+                 noonView.selectedIconBtn.Visible = false;
+                 customView.selectedIconBtn.Visible = false;
+                 value = 2;
+             };
+            noonView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
-                btnsunrisetext.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnsunsettext.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnnoontext.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                btnlogiccustomtext.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                sunriseSelected.Visible = false;
-                sunsetSelected.Visible = false;
-                noonSelected.Visible = true;
-                logiccustomSelected.Visible = false;
+                sunriseView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                sunsetView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                noonView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                customView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                sunriseView.selectedIconBtn.Visible = false;
+                sunsetView.selectedIconBtn.Visible = false;
+                noonView.selectedIconBtn.Visible = true;
+                customView.selectedIconBtn.Visible = false;
                 value = 3;
             };
-            noonFrameLayout.MouseUpEventHandler += sunsetclick;
-            noonRow.MouseUpEventHandler += noonclick;
-            btnnoontext.MouseUpEventHandler += noonclick;
-            noonSelected.MouseUpEventHandler += noonclick;
-
-            EventHandler<MouseEventArgs> ogiccustomclick = (sender, e) =>
+            customView.clickviewBtn.MouseUpEventHandler +=(sender, e) =>
             {
-                btnsunrisetext.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnsunsettext.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnnoontext.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
-                btnlogiccustomtext.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                sunriseSelected.Visible = false;
-                sunsetSelected.Visible = false;
-                noonSelected.Visible = false;
-                logiccustomSelected.Visible = true;
+                sunriseView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                sunsetView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                noonView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor;
+                customView.titleBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
+                sunriseView.selectedIconBtn.Visible = false;
+                sunsetView.selectedIconBtn.Visible = false;
+                noonView.selectedIconBtn.Visible = false;
+                customView.selectedIconBtn.Visible = true;
                 UserView.HomePage.Instance.ScrollEnabled = true;
                 flMain.RemoveFromParent();
 
@@ -882,13 +471,8 @@
                 timeifon.Add("StartMin", "0");
                 SelectedTimeTypeView(middle, 0);
             };
-            logiccustomFrameLayout.MouseUpEventHandler += ogiccustomclick;
-            logiccustomRow.MouseUpEventHandler += ogiccustomclick;
-            btnlogiccustomtext.MouseUpEventHandler += ogiccustomclick;
-            logiccustomSelected.MouseUpEventHandler += ogiccustomclick;
-
             #endregion
-            Btncomplete.MouseUpEventHandler += (sender, e) =>
+            completeView.Btncomplete.MouseUpEventHandler += (sender, e) =>
             {
                 if (value == -1)
                 {
@@ -918,6 +502,6 @@
             };
 
         }
-       
+
     }
 }
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
index 5702a37..16e8dff 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
@@ -17,61 +17,16 @@
         {
             var weeklist = new List<string> ();
 
-
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                Text = titlename,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) => {
-                RemoveFromParent();
-            };
+            #region  涓婇潰鐨勫竷灞�浠g爜
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.Text=titlename;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             #endregion
-
 
             var middle = new VerticalScrolViewLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184-260),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
diff --git a/ZigbeeApp/Shared/Shared.projitems b/ZigbeeApp/Shared/Shared.projitems
index 46cbed2..5c413fb 100644
--- a/ZigbeeApp/Shared/Shared.projitems
+++ b/ZigbeeApp/Shared/Shared.projitems
@@ -410,39 +410,40 @@
     <Compile Include="$(MSBuildThisFileDirectory)Phone\UserCenter\CommonBase\Logic\HdlAlarmsLogic.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\Send.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\EveryyearPage.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\SelectedLogicState.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\TemplatePage.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\SelectedLogicStatus.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\AddScenePage.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicDevicePage.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\SelectedLogic.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicCommunalPage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\MemberList.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\Cycle.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\TimePage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\EverymonthPage.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\TemplateIgnore.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicIfon.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicListAutomation.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\TemplateDeviceCondition.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DelayTime.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\AddLogicPage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\TimePoint.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DeviceStateCondition.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DeviceTarget.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicListPage.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\TemplateDeviceAction.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\IgnoreTime.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\SelectedButton.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\SecurityMode.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\WeekPage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\CustomText.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\LockAddDevice.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\mFunView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\TopView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\TypeView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\CompleteView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\FunView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\SaveView.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\AddAction.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\LockLogicCommunalPage.cs" />
-    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\LockAddScene.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\LockLogicList.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\DoorLockLogic\AddCondition.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\RoomAndDeviceView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\Method.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\CurrentDeviceState.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\Addview.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\AddDeviceView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\SelectedDeviceView.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\SelectedButton.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)Phone\Device\Logic\LogicView\IfString.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="$(MSBuildThisFileDirectory)Pad\" />

--
Gitblit v1.8.0