From 73e6bfcd3eed1b4aa714af538891a3a62864b516 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期四, 05 十二月 2019 14:34:59 +0800
Subject: [PATCH] 2019-12-05-1

---
 ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs |   46 +++++++++++++++++++++++++++++++++++-----------
 1 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
index edb61d2..c387b1c 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
@@ -15,12 +15,14 @@
         }
         Button selectedIcon = new Button();
         public static bool edit = false;
-        VerticalScrolViewLayout middle;
+        VerticalRefreshLayout middle;
+        CommonDevice common;
+        Dictionary<string, string> editdeviceConditionsInfo;
 
-        public async void Show(CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo = null)
+        public void Show(CommonDevice commondevice, Dictionary<string, string> editdeviceConditions = null)
         {
-
-
+            common = commondevice;
+            editdeviceConditionsInfo = editdeviceConditions;
             UserView.HomePage.Instance.ScrollEnabled = false;
             this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
             #region  鏈�涓婇潰鐨勫竷灞�浠g爜
@@ -73,14 +75,36 @@
             };
             #endregion
 
-            middle = new VerticalScrolViewLayout
+            middle = new VerticalRefreshLayout
             {
                 Y = topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
-
+            middle.BeginHeaderRefreshingAction += () =>
+            {
+                //閲嶆柊鍒锋柊logic鍒楄〃
+                string macport = common.DeviceAddr + "_" + common.DeviceEpoint.ToString();
+                for (int i = 0; i < Send.LockList.Count; i++)
+                {
+                    if (Send.LockList[i].DoorLockMacPort == macport)
+                    {
+                        ///浠庡垪琛ㄧЩ闄ゅ綋鍓嶉棬閿佸叏閮ㄧ殑鏃ф暟鎹紱
+                        Send.LockList.Remove(Send.LockList[i]);
+                    }
+                }
+                Read();
+                //鍏抽棴鍒锋柊View锛�
+                middle.EndHeaderRefreshing();
+            };
+            Read();
+        }
+        /// <summary>
+        /// 璇诲彇褰撳墠闂ㄩ攣鐨勪簯绔暟鎹紱
+        /// </summary>
+        public async void Read()
+        {
 
             bool d = false;
             string macport = common.DeviceAddr + "_" + common.DeviceEpoint.ToString();
@@ -100,14 +124,14 @@
                 var allMemberslist = await Send.AllMembers(common.DeviceAddr);
                 Send.LockList.AddRange(allMemberslist);
             }
-            UserList(macport, common, editdeviceConditionsInfo);
+            UserList(macport);
             CommonPage.Loading.Hide();
         }
         /// <summary>
         /// 鎴愬憳鍒楄〃鐨勬柟娉�
         /// </summary>
         /// <param name="macport"></param>
-        void UserList(string macport, CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo)
+        public void UserList(string macport)
         {
 
             foreach (var user in Send.LockList)
@@ -156,7 +180,7 @@
 
                 EventHandler<MouseEventArgs> useridclick = (sender, e) =>
                 {
-                    User(user, common, editdeviceConditionsInfo);
+                    User(user);
 
                 };
                 userBtn.MouseUpEventHandler += useridclick;
@@ -167,12 +191,12 @@
             }
 
 
-        }
+        }          
         /// <summary>
         /// 褰撳墠鎴愬憳淇℃伅鐨勬柟娉�
         /// </summary>
         /// <param name="user"></param>
-        void User(Send.MembershipIfon user, CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo)
+        public void User(Send.MembershipIfon user)
         {
             var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
             this.AddChidren(flMain);

--
Gitblit v1.8.0