| | |
| | | /// </summary> |
| | | private void ShowFunction() |
| | | { |
| | | functionSceneBodyView.RemoveAll(); |
| | | //选择功能--直接从房间的devicelist中获取 |
| | | var deviceList = Room.CurrentRoom.DeviceUIList; |
| | | if (deviceList == null) |
| | |
| | | lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath); |
| | | lightView.SetStatuText(device.GetDeviceStatu()); |
| | | lightView.SetDeviceName(rollerShade.DeviceEpointName); |
| | | //lightView.SetStatu(true); |
| | | lightView.IsSelected = rollerShade.WcdCurrentPositionLiftPercentage == 100; |
| | | lightView.SetCollect(true); |
| | | |
| | |
| | | UserView.HomePage.Instance.AddChidren(rollerShadeControl); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | //rollerShadeControl.action = RefreshBodyView; |
| | | rollerShadeControl.Show(device, Room.CurrentRoom); |
| | | rollerShadeControl.action += (curDev, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Common.Room.CurrentRoom.DeleteDevice(device.FileName); |
| | | ShowFunction(); |
| | | } |
| | | else |
| | | { |
| | | lightView.SetDeviceImage(curDev.IconPath, curDev.OnlineIconPath); |
| | | lightView.SetDeviceName(curDev.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | }; |
| | | |
| | | lightView.CollectButton.MouseUpEventHandler += collectionEvent; |
| | |
| | | var lightControl = new Phone.Device.Light.OnOffControl(); |
| | | UserView.HomePage.Instance.AddChidren(lightControl); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | //lightControl.action = RefreshBodyView; |
| | | lightControl.Show(device, Room.CurrentRoom); |
| | | lightControl.action += (curDev, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Common.Room.CurrentRoom.DeleteDevice(device.FileName); |
| | | ShowFunction(); |
| | | } |
| | | else |
| | | { |
| | | lightView.SetDeviceImage(curDev.IconPath, curDev.OnlineIconPath); |
| | | lightView.SetDeviceName(curDev.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | } |
| | | else if (device.CommonDevice.DfunctionType == DeviceFunctionType.A插座) |
| | | { |
| | | var lightControl = new Phone.Device.Light.PlugControl(); |
| | | UserView.HomePage.Instance.AddChidren(lightControl); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | //lightControl.action = RefreshBodyView; |
| | | lightControl.Show(device, Room.CurrentRoom); |
| | | lightControl.action += (curDev, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Common.Room.CurrentRoom.DeleteDevice(device.FileName); |
| | | ShowFunction(); |
| | | } |
| | | else |
| | | { |
| | | lightView.SetDeviceImage(curDev.IconPath, curDev.OnlineIconPath); |
| | | lightView.SetDeviceName(curDev.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | var lightControl = new Phone.Device.Light.LightControl(); |
| | | UserView.HomePage.Instance.AddChidren(lightControl); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | //lightControl.action = RefreshBodyView; |
| | | lightControl.Show(device, Room.CurrentRoom); |
| | | lightControl.action += (curDev, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Common.Room.CurrentRoom.DeleteDevice(device.FileName); |
| | | ShowFunction(); |
| | | } |
| | | else |
| | | { |
| | | lightView.SetDeviceImage(curDev.IconPath, curDev.OnlineIconPath); |
| | | lightView.SetDeviceName(curDev.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | } |
| | | }; |
| | | |
| | |
| | | lightView.SetDeviceImage(device.IconPath, device.OnlineIconPath); |
| | | lightView.SetStatuText(device.GetDeviceStatu()); |
| | | lightView.SetDeviceName(airSwitch.DeviceEpointName); |
| | | //lightView.SetStatu(true); |
| | | lightView.IsSelected = airSwitch.OnOffStatus == 1; |
| | | lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName)); |
| | | |
| | |
| | | var lightControl = new Phone.Device.Light.AirSwitchControl(); |
| | | UserView.HomePage.Instance.AddChidren(lightControl); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | //lightControl.action = RefreshBodyView; |
| | | lightControl.Show(device, Room.CurrentRoom); |
| | | lightControl.action += (curDev, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Common.Room.CurrentRoom.DeleteDevice(device.FileName); |
| | | ShowFunction(); |
| | | } |
| | | else |
| | | { |
| | | lightView.SetDeviceImage(curDev.IconPath, curDev.OnlineIconPath); |
| | | lightView.SetDeviceName(curDev.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | |
| | | }; |
| | | |
| | | lightView.CollectButton.MouseUpEventHandler += collectionEvent; |
| | |
| | | var lightControl = new Phone.Device.AC.ACControl(); |
| | | UserView.HomePage.Instance.AddChidren(lightControl); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | //lightControl.action = RefreshBodyView; |
| | | lightControl.Show(device, Room.CurrentRoom); |
| | | lightControl.action += (curDev, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Common.Room.CurrentRoom.DeleteDevice(device.FileName); |
| | | ShowFunction(); |
| | | } |
| | | else |
| | | { |
| | | lightView.SetDeviceImage(curDev.IconPath, curDev.OnlineIconPath); |
| | | lightView.SetDeviceName(curDev.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | }; |
| | | |
| | | lightView.CollectButton.MouseUpEventHandler += collectionEvent; |
| | |
| | | var dimmableLightControl = new Phone.Device.Light.DimmableLightControl(); |
| | | UserView.HomePage.Instance.AddChidren(dimmableLightControl); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | //dimmableLightControl.action = RefreshBodyView; |
| | | dimmableLightControl.Show(device, Room.CurrentRoom); |
| | | dimmableLightControl.action += (curDev, curRoom) => |
| | | { |
| | | if (curRoom.Id != Common.Room.CurrentRoom.Id) |
| | | { |
| | | Common.Room.CurrentRoom.DeleteDevice(device.FileName); |
| | | ShowFunction(); |
| | | } |
| | | else |
| | | { |
| | | lightView.SetDeviceImage(curDev.IconPath, curDev.OnlineIconPath); |
| | | lightView.SetDeviceName(curDev.CommonDevice.DeviceEpointName); |
| | | } |
| | | }; |
| | | }; |
| | | lightView.CollectButton.MouseUpEventHandler += collectionEvent; |
| | | } |
| | |
| | | lightView.SetStatuText(device.GetDeviceStatu()); |
| | | lightView.SetDeviceName(device.CommonDevice.DeviceEpointName); |
| | | lightView.CanControl(false); |
| | | lightView.IsSelected = device.CommonDevice.IsOnline == 1; |
| | | //lightView.IsSelected = device.CommonDevice.IsOnline == 1; |
| | | lightView.SetCollect(Room.CurrentRoom.IsCollectInRoom(Room.CurrentRoom, device.FileName)); |
| | | |
| | | var dev = Room.LoveRoomDeviceUIFilePathList.Find((obj) => obj == device.FileName); |
| | |
| | | /// </summary> |
| | | private void ShowScene() |
| | | { |
| | | functionSceneBodyView.RemoveAll(); |
| | | //选择场景 |
| | | var sceneList = Room.CurrentRoom.SceneUIList; |
| | | if (sceneList == null) |