From c0021397eeb8335d6d1f20990c71533c3d94e7af Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 10 一月 2020 17:02:38 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev-tzy' into DEV_GXC

---
 ZigbeeApp/Shared/Phone/Device/Category/Category.cs |  432 ++++++++++++++++++++---------------------------------
 1 files changed, 163 insertions(+), 269 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
old mode 100755
new mode 100644
index 5170e45..26607da
--- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs
@@ -764,11 +764,11 @@
         /// <param name="sender">Sender.</param>
         /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
         private void AutomationBtn_MouseUpEventHandler(object sender, MouseEventArgs mouseEventArgs)
-        {
-            Common.Logic.LogicDviceList.Clear();
-            if (Common.Logic.LogicDviceList.Count == 0)
-            {
-                Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
+        {
+            Common.Logic.LogicDviceList.Clear();
+            if (Common.Logic.LogicDviceList.Count == 0)
+            {
+                Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
             }
             functionBtn.IsSelected = false;
             sceneBtn.IsSelected = false;
@@ -885,7 +885,7 @@
             typeIdDic.Clear();
             foreach (var device in devList)
             {
-                var info = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device.CommonDevice);
+                var info = Common.LocalDevice.Current.GetNotHdlMyDeviceEnumInfo(new List<CommonDevice> { device.CommonDevice });
                 if (info.BeloneType == DeviceBeloneType.A骞叉帴鐐� || info.BeloneType == DeviceBeloneType.A涓户鍣�)
                 {
                     continue;
@@ -1093,7 +1093,7 @@
                                         }
                                     })
                                     { IsBackground = true }.Start();
-                                    
+
                                     var deviceRow = new CategoryFunctionRow(0, 35);
                                     deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
                                     deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
@@ -1134,30 +1134,14 @@
                                     };
                                     deviceRow.ClickBtn.MouseUpEventHandler += (send2, e2) =>
                                     {
-                                        if (deviceUI.CommonDevice.DfunctionType == DeviceFunctionType.A寮�鍏�)
+                                        var lightControl = new Phone.Device.Light.OnOffControl();
+                                        UserView.HomePage.Instance.AddChidren(lightControl);
+                                        UserView.HomePage.Instance.PageIndex += 1;
+                                        lightControl.Show(deviceUI, Common.Room.CurrentRoom);
+                                        lightControl.action += (curDev, curRoom) =>
                                         {
-                                            var lightControl = new Phone.Device.Light.OnOffControl();
-                                            UserView.HomePage.Instance.AddChidren(lightControl);
-                                            UserView.HomePage.Instance.PageIndex += 1;
-                                            //lightControl.action = RefreshBodyView;
-                                            lightControl.Show(deviceUI, Common.Room.CurrentRoom);
-                                        }
-                                        else if (deviceUI.CommonDevice.DfunctionType == DeviceFunctionType.A鎻掑骇)
-                                        {
-                                            var lightControl = new Phone.Device.Light.PlugControl();
-                                            UserView.HomePage.Instance.AddChidren(lightControl);
-                                            UserView.HomePage.Instance.PageIndex += 1;
-                                            //lightControl.action = RefreshBodyView;
-                                            lightControl.Show(deviceUI, Common.Room.CurrentRoom);
-                                        }
-                                        else
-                                        {
-                                            var lightControl = new Phone.Device.Light.LightControl();
-                                            UserView.HomePage.Instance.AddChidren(lightControl);
-                                            UserView.HomePage.Instance.PageIndex += 1;
-                                            //lightControl.action = RefreshBodyView;
-                                            lightControl.Show(deviceUI, Common.Room.CurrentRoom);
-                                        }
+                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
+                                        };
                                     };
 
                                     EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
@@ -1168,21 +1152,7 @@
                                         detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                         detailInfo.EditAction += (curDevice, curRoom) =>
                                         {
-                                            if (curRoom.Id != Common.Room.CurrentRoom.Id)
-                                            {
-                                                Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
-                                                deviceRow.RemoveFromParent();
-                                                sameTypeList.Remove(deviceUI);
-                                                if (sameTypeList.Count == 0)
-                                                {
-                                                    RefreshFunction(Common.Room.CurrentRoom);
-                                                }
-                                            }
-                                            else
-                                            {
-                                                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
-                                                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
-                                            }
+                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                         };
                                     };
                                     var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1265,8 +1235,13 @@
                                         var lightControl = new Phone.Device.Light.AirSwitchControl();
                                         UserView.HomePage.Instance.AddChidren(lightControl);
                                         UserView.HomePage.Instance.PageIndex += 1;
-                                        //lightControl.action = RefreshBodyView;
                                         lightControl.Show(deviceUI, Common.Room.CurrentRoom);
+                                        lightControl.action += (curDev, curRoom) =>
+                                        {
+
+                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
+
+                                        };
                                     };
 
                                     EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
@@ -1277,21 +1252,8 @@
                                         detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                         detailInfo.EditAction += (curDevice, curRoom) =>
                                         {
-                                            if (curRoom.Id != Common.Room.CurrentRoom.Id)
-                                            {
-                                                Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
-                                                deviceRow.RemoveFromParent();
-                                                sameTypeList.Remove(deviceUI);
-                                                if (sameTypeList.Count == 0)
-                                                {
-                                                    RefreshFunction(Common.Room.CurrentRoom);
-                                                }
-                                            }
-                                            else
-                                            {
-                                                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
-                                                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
-                                            }
+                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
+
                                         };
                                     };
                                     var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1376,8 +1338,12 @@
                                         UserView.HomePage.Instance.AddChidren(dimmableLightControl);
                                         UserView.HomePage.Instance.PageIndex += 1;
                                         UserView.HomePage.Instance.ScrollEnabled = false;
-                                        //dimmableLightControl.action = RefreshBodyView;
                                         dimmableLightControl.Show(deviceUI, Common.Room.CurrentRoom);
+                                        dimmableLightControl.action += (curDev, curRoom) =>
+                                        {
+                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
+                                        };
+
                                     };
 
                                     EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
@@ -1388,21 +1354,7 @@
                                         detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                         detailInfo.EditAction += (curDevice, curRoom) =>
                                         {
-                                            if (curRoom.Id != Common.Room.CurrentRoom.Id)
-                                            {
-                                                Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
-                                                deviceRow.RemoveFromParent();
-                                                sameTypeList.Remove(deviceUI);
-                                                if (sameTypeList.Count == 0)
-                                                {
-                                                    RefreshFunction(Common.Room.CurrentRoom);
-                                                }
-                                            }
-                                            else
-                                            {
-                                                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
-                                                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
-                                            }
+                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                         };
                                     };
                                     var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1447,7 +1399,6 @@
                                     var deviceRow = new CategoryFunctionRow(0, 35);
                                     deviceRow.Init(deviceUI.IconPath, deviceUI.OnlineIconPath);
                                     deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
-                                    //deviceRow.SetOnLineStatu(ac.IsOnline == 1);
                                     deviceRow.SetStatuText(deviceUI.GetDeviceStatu());
                                     deviceRow.IsSelected = ac.currentSystemMode != 1;
                                     deviceTypeRowLayout.AddChidren(deviceRow);
@@ -1490,8 +1441,12 @@
                                         UserView.HomePage.Instance.AddChidren(acControl);
                                         UserView.HomePage.Instance.PageIndex += 1;
                                         UserView.HomePage.Instance.ScrollEnabled = false;
-                                        //rollerShadeControl.action = RefreshBodyView;
                                         acControl.Show(deviceUI, Common.Room.CurrentRoom);
+                                        acControl.action += (curDev, curRoom) =>
+                                        {
+                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
+
+                                        };
                                     };
 
                                     EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
@@ -1502,21 +1457,8 @@
                                         detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                         detailInfo.EditAction += (curDevice, curRoom) =>
                                         {
-                                            if (curRoom.Id != Common.Room.CurrentRoom.Id)
-                                            {
-                                                Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
-                                                deviceRow.RemoveFromParent();
-                                                sameTypeList.Remove(deviceUI);
-                                                if (sameTypeList.Count == 0)
-                                                {
-                                                    RefreshFunction(Common.Room.CurrentRoom);
-                                                }
-                                            }
-                                            else
-                                            {
-                                                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
-                                                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
-                                            }
+                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
+
                                         };
                                     };
                                     var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1588,8 +1530,11 @@
                                         UserView.HomePage.Instance.AddChidren(rollerShadeControl);
                                         UserView.HomePage.Instance.PageIndex += 1;
                                         UserView.HomePage.Instance.ScrollEnabled = false;
-                                        //rollerShadeControl.action = RefreshBodyView;
                                         rollerShadeControl.Show(deviceUI, Common.Room.CurrentRoom);
+                                        rollerShadeControl.action += (curDev, curRoom) =>
+                                        {
+                                            ReFreshDeviceActionForWin(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
+                                        };
                                     };
 
                                     EventHandler<MouseEventArgs> deviceDetailHandler = (send2, e2) =>
@@ -1600,21 +1545,7 @@
                                         detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                         detailInfo.EditAction += (curDevice, curRoom) =>
                                         {
-                                            if (curRoom.Id != Common.Room.CurrentRoom.Id)
-                                            {
-                                                Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
-                                                deviceRow.RemoveFromParent();
-                                                sameTypeList.Remove(deviceUI);
-                                                if (sameTypeList.Count == 0)
-                                                {
-                                                    RefreshFunction(Common.Room.CurrentRoom);
-                                                }
-                                            }
-                                            else
-                                            {
-                                                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
-                                                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
-                                            }
+                                            ReFreshDeviceActionForWin(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                         };
                                     };
                                     var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1626,7 +1557,6 @@
                                         deviceTypeRowLayout.AddRightView(editBtn);
                                         editBtn.MouseUpEventHandler += deviceDetailHandler;
                                     }
-
                                 }
                             }
                             else if (deviceUI.CommonDevice.Type == DeviceType.DoorLock)
@@ -1653,21 +1583,7 @@
                                     detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                     detailInfo.EditAction += (curDevice, curRoom) =>
                                     {
-                                        if (curRoom.Id != Common.Room.CurrentRoom.Id)
-                                        {
-                                            Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
-                                            deviceRow.RemoveFromParent();
-                                            sameTypeList.Remove(deviceUI);
-                                            if (sameTypeList.Count == 0)
-                                            {
-                                                RefreshFunction(Common.Room.CurrentRoom);
-                                            }
-                                        }
-                                        else
-                                        {
-                                            deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
-                                            deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
-                                        }
+                                        ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                     };
                                 };
                                 var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1698,21 +1614,7 @@
                                     detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                     detailInfo.EditAction += (curDevice, curRoom) =>
                                     {
-                                        if (curRoom.Id != Common.Room.CurrentRoom.Id)
-                                        {
-                                            Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
-                                            deviceRow.RemoveFromParent();
-                                            sameTypeList.Remove(deviceUI);
-                                            if (sameTypeList.Count == 0)
-                                            {
-                                                RefreshFunction(Common.Room.CurrentRoom);
-                                            }
-                                        }
-                                        else
-                                        {
-                                            deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
-                                            deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
-                                        }
+                                        ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                     };
                                 };
                                 var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1780,21 +1682,7 @@
                                         detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                         detailInfo.EditAction += (curDevice, curRoom) =>
                                         {
-                                            if (curRoom.Id != Common.Room.CurrentRoom.Id)
-                                            {
-                                                Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
-                                                deviceRow.RemoveFromParent();
-                                                sameTypeList.Remove(deviceUI);
-                                                if (sameTypeList.Count == 0)
-                                                {
-                                                    RefreshFunction(Common.Room.CurrentRoom);
-                                                }
-                                            }
-                                            else
-                                            {
-                                                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
-                                                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
-                                            }
+                                            ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                         };
                                     };
                                     var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1825,21 +1713,7 @@
                                     detailInfo.Show(deviceUI, Shared.Common.Room.CurrentRoom);
                                     detailInfo.EditAction += (curDevice, curRoom) =>
                                     {
-                                        if (curRoom.Id != Common.Room.CurrentRoom.Id)
-                                        {
-                                            Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
-                                            deviceRow.RemoveFromParent();
-                                            sameTypeList.Remove(deviceUI);
-                                            if (sameTypeList.Count == 0)
-                                            {
-                                                RefreshFunction(Common.Room.CurrentRoom);
-                                            }
-                                        }
-                                        else
-                                        {
-                                            deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
-                                            deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
-                                        }
+                                        ReFreshDeviceAction(deviceUI, curRoom, sameTypeList, deviceListScrolView, deviceRow);
                                     };
                                 };
                                 var editBtn = new CommonForm.RowLayoutEditButton()
@@ -1852,7 +1726,6 @@
                                     editBtn.MouseUpEventHandler += deviceDetailHandler;
                                 }
                             }
-
 
                             //鍒犻櫎璁惧
                             EventHandler<MouseEventArgs> delEvent = (delSender, delE) =>
@@ -1874,7 +1747,7 @@
                                         sameTypeList.Remove(deviceUI);
                                         if (Common.Room.CurrentRoom.GetLoveRoom().DeviceUIList.Find((obj) => obj.FileName == deviceUI.FileName) != null)
                                         {
-                                            Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
+                                            Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(deviceUI.FileName);
                                         }
                                     }
                                     if (sameTypeList.Count == 0)
@@ -1899,6 +1772,93 @@
                 { IsBackground = true }.Start();
             }
         }
+
+        /// <summary>
+        /// ReFreshDeviceAction
+        /// </summary>
+        /// <param name="curRoom"></param>
+        /// <param name="sameTypeList"></param>
+        /// <param name="devListScrolView"></param>
+        /// <param name="deviceRow"></param>
+        private void ReFreshDeviceAction(DeviceUI deviceUI, Common.Room curRoom, List<DeviceUI> sameTypeList, VerticalScrolViewLayout devListScrolView, CategoryFunctionRow deviceRow)
+        {
+            if (Common.Room.CurrentRoom.IsLove)
+            {
+                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
+                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+                if (Common.Room.CurrentRoom.IsCollectInRoom(deviceUI.FileName) == false)
+                {
+                    devListScrolView.RemoveViewByTag(deviceUI);
+                    sameTypeList.Remove(deviceUI);
+                    if (sameTypeList.Count == 0)
+                    {
+                        RefreshFunction(Common.Room.CurrentRoom);
+                    }
+                }
+            }
+            else
+            {
+                if (curRoom.Id != Common.Room.CurrentRoom.Id)
+                {
+                    Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
+                    devListScrolView.RemoveViewByTag(deviceUI);
+                    sameTypeList.Remove(deviceUI);
+                    if (sameTypeList.Count == 0)
+                    {
+                        RefreshFunction(Common.Room.CurrentRoom);
+                    }
+                }
+                else
+                {
+                    deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
+                    deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+                }
+            }
+        }
+
+        /// <summary>
+        /// ReFreshDeviceAction
+        /// </summary>
+        /// <param name="curRoom"></param>
+        /// <param name="sameTypeList"></param>
+        /// <param name="devListScrolView"></param>
+        /// <param name="deviceRow"></param>
+        private void ReFreshDeviceActionForWin(DeviceUI deviceUI, Common.Room curRoom, List<DeviceUI> sameTypeList, VerticalScrolViewLayout devListScrolView, CategoryFunctionForWinRow deviceRow)
+        {
+            if (Common.Room.CurrentRoom.IsLove)
+            {
+                deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
+                deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+                if (Common.Room.CurrentRoom.IsCollectInRoom(deviceUI.FileName) == false)
+                {
+                    devListScrolView.RemoveViewByTag(deviceUI);
+                    sameTypeList.Remove(deviceUI);
+                    if (sameTypeList.Count == 0)
+                    {
+                        RefreshFunction(Common.Room.CurrentRoom);
+                    }
+                }
+            }
+            else
+            {
+                if (curRoom.Id != Common.Room.CurrentRoom.Id)
+                {
+                    Shared.Common.Room.CurrentRoom.DeleteDevice(deviceUI.FileName);
+                    devListScrolView.RemoveViewByTag(deviceUI);
+                    sameTypeList.Remove(deviceUI);
+                    if (sameTypeList.Count == 0)
+                    {
+                        RefreshFunction(Common.Room.CurrentRoom);
+                    }
+                }
+                else
+                {
+                    deviceRow.SetDeviceIcon(deviceUI.IconPath, deviceUI.OnlineIconPath);
+                    deviceRow.SetTitle(deviceUI.CommonDevice.DeviceEpointName);
+                }
+            }
+        }
+
 
         /// <summary>
         /// AddRoomView
@@ -2110,14 +2070,15 @@
         #endregion
 
         #region 鈼� 鑷姩鍖朹_________________________
-      
+
         /// <summary>
-        /// 鑷姩鍖栧姛鑳戒唬鐮佸叆鍙�
+        /// 鑷姩鍖�
         /// </summary>
-        private  void ShowAutotion()
-        {
-           // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-           
+        private async void ShowAutotion()
+        {
+
+            functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
+
             var bjFrameLayout = new FrameLayout
             {
                 Width = Application.GetRealWidth(1080 - 58),
@@ -2128,7 +2089,7 @@
                 Y = Application.GetRealHeight(30),
             };
             functionSceneAutoBodyView.AddChidren(bjFrameLayout);
-            bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft);
+            bjFrameLayout.SetCornerWithSameRadius(25, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft);
             var sigBtn = new Button
             {
                 Width = Application.GetMinRealAverage(84),
@@ -2174,16 +2135,18 @@
             };
             functionSceneAutoBodyView.AddChidren(scenehorizontalScrol);
 
-            var logicScrolView = new VerticalRefreshLayout//VerticalScrolViewLayout
+            var logicScrolView = new VerticalScrolViewLayout
             {
                 Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30),
-                //BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,/
+                BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
                 X = Application.GetRealWidth(58),
+                //Radius = (uint)Application.GetRealHeight(50),
                 Y = scenehorizontalScrol.Bottom,
             };
             functionSceneAutoBodyView.AddChidren(logicScrolView);
-            logicScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
-            bool no = false;
+            logicScrolView.SetCornerWithSameRadius(20, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft);
+
+
             recommendswitchBtn.MouseUpEventHandler += (sender, e) =>
             {
                 int Yheight = 0;
@@ -2191,7 +2154,6 @@
                 scenehorizontalScrol.RemoveAll();
                 if (recommendswitchBtn.IsSelected)
                 {
-                    no = true;
                     scenehorizontalScrol.Height = Application.GetRealHeight(246);
                     Yheight = 20;
                     for (int i = 1; i < 4; i++)
@@ -2269,32 +2231,14 @@
                 }
                 else
                 {
-                    no = false;
                     scenehorizontalScrol.Height = Application.GetRealHeight(0);
                     Yheight = 0;
                 }
                 logicScrolView.Y = scenehorizontalScrol.Bottom + Yheight;
                 logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight;
-                Automationview(logicScrolView,no);
+                Automationview(logicScrolView);
             };
-            logicScrolView.BeginHeaderRefreshingAction += () =>
-            {
-                //閲嶆柊鍒锋柊logic鍒楄〃
-                Common.Logic.LogicList.Clear();
-                Read(logicScrolView,no);
-                //鍏抽棴鍒锋柊View锛�
-                logicScrolView.EndHeaderRefreshing();
-            };
-           
-            Read(logicScrolView,no);
 
-        }
-        /// <summary>
-        /// 璇诲彇鑷姩鍖栧垪琛ㄦ暟鎹紱
-        /// </summary>
-        /// <param name="logicScrolView"></param>
-        private async void Read(VerticalRefreshLayout logicScrolView,bool no)
-        {
             CommonPage.Loading.Start();
             if (Common.Logic.LogicList.Count == 0)
             {
@@ -2315,77 +2259,28 @@
                 }
             }
             //鑷姩鍖�
-            Automationview(logicScrolView,no);
+            Automationview(logicScrolView);
             CommonPage.Loading.Hide();
+
         }
+
         /// <summary>
-        /// 鍔犺浇鑷姩鍖栧垪琛ㄧ晫闈�
+        /// 鑷姩鍖栧垪琛ㄧ晫闈�
         /// </summary>
         /// <param name="refresview">Refresview.</param>
-        private async void Automationview(VerticalRefreshLayout refresview,bool no)
+        private async void Automationview(VerticalScrolViewLayout refresview)
         {
             refresview.RemoveAll();
-            if (Common.Logic.LogicList.Count == 0&&no==false)
-            {
-                //灏辨槸涓轰簡鏄剧ず寮曞娣诲姞鍥炬爣;
-                refresview.BackgroundColor = 0x00000000;
-                var noFrameLayout = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(434+ 200+32+160),
-                    //BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
-                };
-                refresview.AddChidren(noFrameLayout);
-
-
-                var noIconBtn = new Button
-                {
-                    Y=Application.GetRealHeight(160),
-                    Width = Application.GetMinRealAverage(756),
-                    Height = Application.GetMinRealAverage(434),
-                    UnSelectedImagePath = "Item/NoFunction.png",
-                    X = Application.GetRealWidth(104),
-                };
-                noFrameLayout.AddChidren(noIconBtn);
-
-                var noTextBtn = new Button()
-                {
-                    Y = noIconBtn.Bottom,
-                    Height = Application.GetRealHeight(200)+Application.GetRealHeight(32),
-                    Width = Application.GetRealWidth(700),
-                    //Gravity = Gravity.CenterHorizontal,
-                    Text = Language.StringByID(MyInternationalizationString.automationaddtext).Replace("{\\r\\n}", "\r\n"),
-                    TextColor = ZigbeeColor.Current.GXCPlaceHolderTextColor,
-                    TextAlignment = TextAlignment.Center,
-                    IsMoreLines = true,
-                    X = Application.GetRealWidth(190-58),
-                };
-                noFrameLayout.AddChidren(noTextBtn);
-
-            }
-            else
-            {
-
-                if (Common.Logic.LogicList.Count == 0 && no == true)
-                {
-                    ///鏀瑰彉婊戝姩view鐨勯鑹诧紱
-                    refresview.BackgroundColor = 0x00000000;
-                }
-                else
-                {
-                    refresview.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
-                }
-            }
             foreach (var logic in Common.Logic.LogicList)
             {
 
-                
+
                 var logicRowlayout = new RowLayout
                 {
                     Height = Application.GetRealHeight(190 + 30),
-                    Width = Application.GetRealWidth(1080-58),
+                    Width = Application.GetRealWidth(1080),
                     LineColor = ZigbeeColor.Current.LogicBackgroundColor,
-                   BackgroundColor =ZigbeeColor.Current.LogicBackgroundColor,
-                   
+                    BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
                 };
                 refresview.AddChidren(logicRowlayout);
 
@@ -2411,7 +2306,7 @@
                     Height = Application.GetMinRealAverage(63),
                     UnSelectedImagePath = "ZigeeLogic/logicclose.png",
                     SelectedImagePath = "ZigeeLogic/logicopen.png",
-                    X = logicRowlayout.Width - Application.GetRealWidth(104 + 58),
+                    X = logicRowlayout.Width - Application.GetRealWidth(104 + 58 + 58),
                     Y = Application.GetRealHeight(58 + 30 + 9 + 30),
                 };
                 logicRowlayout.AddChidren(logicswitchBtn);
@@ -2460,7 +2355,7 @@
                     var logicCommunalPage = new Logic.LogicCommunalPage();
                     HomePage.Instance.AddChidren(logicCommunalPage);
                     HomePage.Instance.PageIndex += 1;
-                    logicCommunalPage.Show(() => { logicnameBtn.Text = logic.LogicName; Automationview(refresview,no); });
+                    logicCommunalPage.Show(() => { logicnameBtn.Text = logic.LogicName; Automationview(refresview); });
 
                 };
 
@@ -2482,7 +2377,7 @@
                         if (e1)
                         {
                             Common.Logic.LogicList.Remove(logic);
-                            Automationview(refresview,no);
+                            Automationview(refresview);
                             Logic.Send.DelLogic(logic.LogicId);
                         }
                     };
@@ -2492,7 +2387,7 @@
                 var line = new Button
                 {
                     Y = Application.GetRealHeight(215),
-                    Height = Application.GetRealHeight(5), 
+                    Height = Application.GetRealHeight(5),
                     Width = Application.GetRealWidth(1080 - 58),
                     BackgroundColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
                     X = Application.GetRealWidth(58),
@@ -2502,7 +2397,7 @@
 
         }
         /// <summary>
-        /// 鏄剧ず鑷姩鍖栬緭鍑哄姛鑳芥ā鍧楀浘鏍囩殑棰滆壊
+        /// 鏄剧ず鍥炬爣鐨勯鑹�
         /// </summary>
         /// <param name="logic"></param>
         /// <param name="logicRowlayout"></param>
@@ -2513,7 +2408,7 @@
             var logictimeBtn = new Button
             {
                 Height = Application.GetRealHeight(58),
-                Width = logicRowlayout.Width - Application.GetRealWidth(58 + 12 + 350),
+                Width = logicRowlayout.Width - Application.GetRealWidth(58 + 12 + 350 + 58),
                 Y = Application.GetRealHeight(30),
                 X = Application.GetRealWidth(365),
                 TextAlignment = TextAlignment.CenterRight,
@@ -2901,7 +2796,6 @@
                 }
             }
         }
-
         #endregion
 
         #region 鈼� 鎺у埗鐘舵�乢________________________
@@ -2976,6 +2870,6 @@
 
         #endregion
 
-   
+
     }
 }

--
Gitblit v1.8.0