| | |
| | | { |
| | | public class UserDoorLockPage : DoorLockCommonLayout, ZigBee.Common.IStatus |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 构造函数 |
| | | /// </summary> |
| | | /// <param name="room"></param> |
| | | /// <param name="doorLock"></param> |
| | | public UserDoorLockPage(Shared.Common.Room room, DeviceUI doorLock) |
| | | { |
| | | this.doorLock = doorLock.CommonDevice as ZigBee.Device.DoorLock; |
| | |
| | | ZigBee.Device.ZbGateway.StatusList.Add(this); |
| | | } |
| | | |
| | | #region ◆ 变量申明__________________________ |
| | | #region 变量申明 |
| | | /// <summary> |
| | | /// 当前门锁 |
| | | /// </summary> |
| | | ZigBee.Device.DoorLock doorLock; |
| | | /// <summary> |
| | | /// 底部布局 |
| | | /// </summary> |
| | | FrameLayout bottomFrameLayout; |
| | | /// <summary> |
| | | /// 当前房间 |
| | | /// </summary> |
| | | Shared.Common.Room currentRoom; |
| | | /// <summary> |
| | | /// 设备UI对象 |
| | | /// </summary> |
| | | DeviceUI deviceUI; |
| | | /// <summary> |
| | | /// 设置二次验证Action |
| | | /// </summary> |
| | | Action action; |
| | | /// <summary> |
| | | /// 中部布局中门锁名称显示 |
| | | /// </summary> |
| | | Button btnDoorLockTitle; |
| | | #endregion |
| | | |
| | |
| | | /// </summary> |
| | | public void Show() |
| | | { |
| | | this.TopFrameLayout(this, ""); |
| | | |
| | | this.TopFrameLayout(this, ""); |
| | | EventHandler<MouseEventArgs> eHandlerBack = (sender, e) => |
| | | { |
| | | RemoveFromParent(); |
| | |
| | | { |
| | | X = Application.GetRealWidth(850 - 116), |
| | | Height = Application.GetRealHeight(69), |
| | | Width = Application.GetRealWidth(69), |
| | | Width = Application.GetRealWidth(0), |
| | | }; |
| | | this.titleFrameLayout.AddChidren(btnShare); |
| | | |
| | |
| | | UnSelectedImagePath = "DoorLock/SettingIcon.png", |
| | | }; |
| | | btnFuncSetFrameLayout.AddChidren(btnFuncSet); |
| | | btnFuncSet.MouseDownEventHandler += (sender, e) => |
| | | EventHandler<MouseEventArgs> btnFuncSetHander = (sender, e) => |
| | | { |
| | | var functionSetting = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(functionSetting); |
| | |
| | | } |
| | | }; |
| | | }; |
| | | |
| | | btnShare.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | |
| | | }; |
| | | |
| | | btnFuncSetFrameLayout.MouseDownEventHandler += btnFuncSetHander; |
| | | btnFuncSet.MouseDownEventHandler += btnFuncSetHander; |
| | | |
| | | MidFrameLayoutContent(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 中部布局 |
| | | /// </summary> |
| | | public void MidFrameLayoutContent() |
| | | { |
| | | #region UI |
| | |
| | | //获取Mac名字 |
| | | btnDoorLockTitle.Text = Common.LocalDevice.Current.GetDeviceMacName(doorLock); |
| | | |
| | | var btnRecordFrameLayout = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(69+15+46), |
| | | Height = Application.GetRealHeight(69+46 * 2), |
| | | X = Application.GetRealWidth(752-46), |
| | | }; |
| | | midTopFrameLayout.AddChidren(btnRecordFrameLayout); |
| | | |
| | | var btnRecord = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(69), |
| | | Height = Application.GetRealHeight(69), |
| | | X = Application.GetRealWidth(752), |
| | | X = Application.GetRealWidth(46), |
| | | Y = Application.GetRealHeight(46), |
| | | UnSelectedImagePath = "DoorLock/RecordIcon.png", |
| | | }; |
| | | midTopFrameLayout.AddChidren(btnRecord); |
| | | btnRecord.MouseDownEventHandler += (sender, e) => |
| | | btnRecordFrameLayout.AddChidren(btnRecord); |
| | | EventHandler<MouseEventArgs> handerRecord = (sender, e) => |
| | | { |
| | | //历史记录 ---- stan |
| | | var form = new DeviceDoorLock.DoorLockHistoryLogForm(); |
| | | form.AddForm(this.doorLock.DeviceAddr); |
| | | }; |
| | | btnRecordFrameLayout.MouseDownEventHandler += handerRecord; |
| | | btnRecord.MouseDownEventHandler += handerRecord; |
| | | var btnCollectFrameLayout = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(69+15+46), |
| | | Height = Application.GetRealHeight(69+46*2), |
| | | X = Application.GetRealWidth(850-15), |
| | | }; |
| | | midTopFrameLayout.AddChidren(btnCollectFrameLayout); |
| | | |
| | | var btnCollect = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(69), |
| | | Height = Application.GetRealHeight(69), |
| | | X = Application.GetRealWidth(850), |
| | | X = Application.GetRealWidth(15), |
| | | Y = Application.GetRealHeight(46), |
| | | UnSelectedImagePath = "Item/Collection.png", |
| | | SelectedImagePath = "Item/CollectionSelected.png" |
| | | }; |
| | | midTopFrameLayout.AddChidren(btnCollect);
|
| | | btnCollectFrameLayout.AddChidren(btnCollect);
|
| | | var de = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == deviceUI.FileName);
|
| | | if (de == null)
|
| | | {
|
| | |
| | | {
|
| | | btnCollect.IsSelected = true;
|
| | | } |
| | | btnCollect.MouseDownEventHandler += (sender, e) => |
| | | EventHandler < MouseEventArgs > handerCollect = (sender, e) => |
| | | { |
| | | btnCollect.IsSelected = !btnCollect.IsSelected; |
| | | if (btnCollect.IsSelected) |
| | |
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(deviceUI.FileName); //取消收藏 |
| | | } |
| | | }; |
| | | |
| | | btnCollectFrameLayout.MouseDownEventHandler += handerCollect; |
| | | btnCollect.MouseDownEventHandler += handerCollect; |
| | | var btnCurrentText = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(100), |
| | |
| | | btnCurrentFrameLayout.AddChidren(btnCurrentRoomName); |
| | | #endregion |
| | | |
| | | #region 数据处理 |
| | | EventHandler<MouseEventArgs> hander1 = async (sender, e) => |
| | | { |
| | | openFrameLayout.Enable = false; |
| | |
| | | } |
| | | else |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.NoAccess), Direction = AMPopTipDirection.Down, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.NoAccess)); |
| | | openFrameLayout.Enable = true; |
| | | btnDoorOpenPic.Enable = true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Down, CloseTime = 1 }.Show(Common.CommonPage.Instance); |
| | | this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.AccountIsFreezed)); |
| | | openFrameLayout.Enable = true; |
| | | btnDoorOpenPic.Enable = true; |
| | | } |
| | |
| | | }; |
| | | closeFrameLayout.MouseUpEventHandler += hander2; |
| | | btnDoorClosePic.MouseUpEventHandler += hander2; |
| | | #endregion |
| | | } |
| | | |
| | | #region ◆ 接口实现__________________________ |
| | | #region 接口实现 |
| | | /// <summary> |
| | | /// 处理变化事件 --将弃用 改用DeviceInfoChange() |
| | | /// </summary> |