| | |
| | | using Shared.Phone.Device.AC; |
| | | using ZigBee.Device; |
| | | using Shared.Phone.Device.CommonForm; |
| | | using Shared.Phone.UserCenter.DoorLock; |
| | | |
| | | namespace Shared.Phone.UserView |
| | | { |
| | |
| | | roomPageView.AddChidren(roomBackView); |
| | | var roomBG = new Button() |
| | | { |
| | | UnSelectedImagePath = "Room/HomeBG.png", |
| | | //UnSelectedImagePath = "Room/HomeBG.png", |
| | | UnSelectedImagePath = room.BackgroundImage |
| | | }; |
| | | roomBackView.AddChidren(roomBG); |
| | | var roomName = new Button() |
| | |
| | | Width = Application.GetMinRealAverage(100), |
| | | Height = Application.GetMinRealAverage(100), |
| | | UnSelectedImagePath = "Item/List.png", |
| | | SelectedImagePath = "Item/ListSelected.png" |
| | | }; |
| | | roomBackView.AddChidren(roomListBtn); |
| | | |
| | | roomListBtn.MouseUpEventHandler += (send, e) => |
| | | { |
| | | //var roomList = new Device.Room.RoomManagement(); |
| | | //HomePage.Instance.AddChidren(roomList); |
| | | //HomePage.Instance.PageIndex += 1; |
| | | //roomList.Show(); |
| | | //roomList.action += () => |
| | | //{ |
| | | // Show(); |
| | | //}; |
| | | if(room.IsLove) |
| | | { |
| | | return; |
| | | } |
| | | var editRoom = new Device.Room.EditRoom(); |
| | | HomePage.Instance.AddChidren(editRoom); |
| | | HomePage.Instance.PageIndex += 1; |
| | |
| | | { |
| | | Show(); |
| | | }; |
| | | |
| | | }; |
| | | } |
| | | } |
| | |
| | | Text = Language.StringByID(R.MyInternationalizationString.Favorite), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | TextSize = 18, |
| | | TextSize = 18 |
| | | }; |
| | | roomBackView.AddChidren(roomName); |
| | | var roomListBtn = new Button() |
| | |
| | | deviceVerticalScrolViewLayout.AddChidren(itemView); |
| | | } |
| | | |
| | | |
| | | //删除设备 |
| | | EventHandler<MouseEventArgs> delEvent = (sender, e) => |
| | | { |
| | |
| | | var dimmableLightControl = new Phone.Device.Light.DimmableLightControl(); |
| | | UserView.HomePage.Instance.AddChidren(dimmableLightControl); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | //dimmableLightControl.action = RefreshBodyView; |
| | | dimmableLightControl.Show(device, Room.CurrentRoom); |
| | | }; |
| | | |
| | | lightView.CollectButton.MouseUpEventHandler += collectionEvent; |
| | | } |
| | | else if (device.CommonDevice.Type == DeviceType.OnOffSwitch) |
| | | else if (device.CommonDevice.Type == ZigBee.Device.DeviceType.DoorLock) |
| | | { |
| | | //门锁 |
| | | var dimmableLight = device.CommonDevice as DoorLock; |
| | | //补上非远程 |
| | | if (dimmableLight.Gateway == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (dimmableLight.Gateway.IsVirtual) |
| | | { |
| | | ReadStatus(dimmableLight, () => |
| | | { |
| | | dimmableLight.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | if ((DateTime.Now - dimmableLight.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan) |
| | | { |
| | | dimmableLight.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | } |
| | | } |
| | | |
| | | var lightView = new FunctionMainView(xx, yy); |
| | | itemView.AddChidren(lightView); |
| | | lightView.Init(); |
| | | lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath); |
| | | lightView.SetStatuText(device.GetDeviceStatu()); |
| | | lightView.SetDeviceName(device.CommonDevice.DeviceEpointName); |
| | | lightView.IsSelected = dimmableLight.IsOnline == 1; |
| | | lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName)); |
| | | lightView.CanControl(false); |
| | | var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName); |
| | | if (dev == null) |
| | | { |
| | | lightView.CollectButton.IsSelected = false; |
| | | } |
| | | else |
| | | { |
| | | lightView.CollectButton.IsSelected = true; |
| | | } |
| | | |
| | | lightView.CardBG.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var userDoorLockPage = new UserDoorLockPage(Room.CurrentRoom,device); |
| | | HomePage.Instance.AddChidren(userDoorLockPage); |
| | | HomePage.Instance.PageIndex += 1; |
| | | userDoorLockPage.Show(); |
| | | }; |
| | | lightView.CollectButton.MouseUpEventHandler += collectionEvent; |
| | | } |
| | | else |
| | | { |
| | | var lightView = new FunctionMainView(xx, yy); |
| | | itemView.AddChidren(lightView); |
| | |
| | | lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath); |
| | | lightView.SetStatuText(device.GetDeviceStatu()); |
| | | lightView.SetDeviceName(device.CommonDevice.DeviceEpointName); |
| | | //lightView.SetStatu(true); |
| | | lightView.IsSelected = true; |
| | | lightView.CanControl(false); |
| | | lightView.IsSelected = device.CommonDevice.IsOnline == 1; |
| | | lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName)); |
| | | |
| | | var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName); |
| | | if (dev == null) |
| | | { |
| | | lightView.CollectButton.IsSelected = false; |
| | | } |
| | | else |
| | | { |
| | | lightView.CollectButton.IsSelected = true; |
| | | } |
| | | lightView.CollectButton.MouseUpEventHandler += collectionEvent; |
| | | } |
| | | } |
| | | } |