using System; using ZigBee.Device; namespace Shared.Phone.UserCenter.DoorLock { public class MemberManagement : DoorLockCommonLayout, ZigBee.Common.IStatus { /// /// 构造函数 /// /// public MemberManagement(ZigBee.Device.DoorLock doorLock) { this.doorLock = doorLock; BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; } #region ◆ 变量申明__________________________ ZigBee.Device.DoorLock doorLock; #endregion void ReadDoorLockUserInfo() { System.Threading.Tasks.Task.Run(async () => { try { var list = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockAllAcountUserlist(doorLock); } catch { } finally { } }); } /// /// UI显示 /// public void Show() { this.TopFrameLayout(this, Language.StringByID(R.MyInternationalizationString.MemberManagement)); EventHandler eHandlerBack = (sender, e) => { RemoveFromParent(); }; this.btnBack.MouseUpEventHandler += eHandlerBack; this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack; this.MidFrameLayout(this); MidFrameLayoutContent(); } public void MidFrameLayoutContent() { var bodyView = new VerticalRefreshLayout() { }; this.midFrameLayout.AddChidren(bodyView); bodyView.BeginHeaderRefreshingAction += () => { bodyView.BeginHeaderRefreshing(); ReadDoorLockUserInfo(); bodyView.EndHeaderRefreshing(); }; for (int i = 0; i < 3; i++) { var RowView = new FrameLayout() { Height = Application.GetRealHeight(150), }; bodyView.AddChidren(RowView); var btnMemberName = new Button() { X = Application.GetRealWidth(58), Y = Application.GetRealHeight(58), Width = Application.GetRealWidth(743), Height = Application.GetRealHeight(58), TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextAlignment = TextAlignment.CenterLeft, TextSize = 14, }; RowView.AddChidren(btnMemberName); var btnRight = new Button() { X = Application.GetRealWidth(58 + 899), Y = Application.GetRealHeight(58), Height = Application.GetRealHeight(58), Width = Application.GetRealWidth(58), UnSelectedImagePath = "Item/Next.png", SelectedImagePath = "Item/Down.png", }; RowView.AddChidren(btnRight); var line2 = new Button() { Y = RowView.Height - 1, X = Application.GetRealWidth(58), Width = Application.GetRealWidth(965), Height = 1, BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, }; RowView.AddChidren(line2); int currentIndex = i; EventHandler eHandler = (sender, e) => { //var doorLock = new ZigBee.Device.DoorLock(); //var memberFrozenPage = new Shared.Phone.UserCenter.DoorLock.MemberFrozenPage(doorLock); //Shared.Phone.UserView.HomePage.Instance.AddChidren(memberFrozenPage); //Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; //memberFrozenPage.Show(); }; btnRight.MouseUpEventHandler += eHandler; RowView.MouseUpEventHandler += eHandler; } } #region ◆ 接口实现__________________________ /// /// 处理变化事件 --将弃用 改用DeviceInfoChange() /// /// The changed. /// Common. public void Changed(CommonDevice common) { } /// /// 处理变化事件 /// /// /// public void DeviceInfoChange(CommonDevice common, string typeTag) { } /// /// Changeds the IL ogic status. /// /// Logic. public void ChangedILogicStatus(ZigBee.Device.Logic logic) { } /// /// Changeds the IS cene status. /// /// Scene. public void ChangedISceneStatus(Scene scene) { } #endregion } }