| | |
| | | public class UserDoorLockPage : DoorLockCommonLayout, ZigBee.Common.IStatus |
| | | { |
| | | |
| | | public UserDoorLockPage(Shared.Common.Room room ,DeviceUI doorLock) |
| | | public UserDoorLockPage(Shared.Common.Room room, DeviceUI doorLock) |
| | | { |
| | | this.doorLock = doorLock.CommonDevice as ZigBee.Device.DoorLock; |
| | | currentRoom = room; |
| | | deviceUI = doorLock; |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; |
| | | BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor; |
| | | ZigBee.Device.ZbGateway.StatusList.Add(this); |
| | | } |
| | | |
| | |
| | | UnSelectedImagePath = "Item/Collection.png", |
| | | SelectedImagePath = "Item/CollectionSelected.png" |
| | | }; |
| | | midTopFrameLayout.AddChidren(btnCollect); |
| | | midTopFrameLayout.AddChidren(btnCollect);
|
| | | var de = Shared.Common.Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == deviceUI.FileName);
|
| | | if (de == null)
|
| | | {
|
| | | btnCollect.IsSelected = false;
|
| | | }
|
| | | else
|
| | | {
|
| | | btnCollect.IsSelected = true;
|
| | | } |
| | | btnCollect.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | btnCollect.IsSelected = !btnCollect.IsSelected; |
| | | if (btnCollect.IsSelected) |
| | | { |
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(deviceUI.FileName); //取消收藏 |
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().AddDevice(deviceUI.FileName);//收藏 |
| | | } |
| | | else |
| | | { |
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().AddDevice(deviceUI.FileName);//收藏 |
| | | {
|
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(deviceUI.FileName); //取消收藏 |
| | | } |
| | | }; |
| | | |