| | |
| | | {
|
| | | //没有状态功能,则把设备名字控件中
|
| | | this.btnDeviceName.Gravity = Gravity.CenterVertical;
|
| | | btnDeviceName.Y += this.chidrenYaxis;
|
| | | }
|
| | | //拥有状态功能
|
| | | if (this.hadStatuFunction == true)
|
| | |
| | | {
|
| | | //关闭左滑菜单
|
| | | this.HideMenu();
|
| | | var detailInfo = new Device.CommonForm.DeviceDetailInfo { };
|
| | | UserView.HomePage.Instance.AddChidren(detailInfo);
|
| | | UserView.HomePage.Instance.PageIndex += 1;
|
| | | detailInfo.Show(i_device, HdlRoomLogic.Current.CurrentRoom);
|
| | | detailInfo.EditAction += (curDevice, curRoom) =>
|
| | | var detailInfo = new MainPage.DeviceDetailInfoForm();
|
| | | detailInfo.AddForm(i_device, HdlRoomLogic.Current.CurrentRoom);
|
| | | detailInfo.FormCloseEvent += (curDevice, curRoom) =>
|
| | | {
|
| | | if (HdlRoomLogic.Current.CurrentRoom.IsLove == true)
|
| | | {
|
| | | //当前是喜爱房间时
|
| | | if (HdlRoomLogic.Current.IsCollectInRoom(this.device) == false)
|
| | | {
|
| | | //房间改变了
|
| | | this.RemoveFromParent();
|
| | | //回调控件被移除的事件
|
| | | this.RowNeedRemoveEvent?.Invoke();
|
| | | //房间改变了
|
| | | this.RemoveFromParent();
|
| | | return;
|
| | | }
|
| | | }
|
| | | else if (HdlRoomLogic.Current.CurrentRoom.Id != curRoom.Id)
|
| | | {
|
| | | //房间改变了
|
| | | this.RemoveFromParent();
|
| | | //回调控件被移除的事件
|
| | | this.RowNeedRemoveEvent?.Invoke();
|
| | | //房间改变了
|
| | | this.RemoveFromParent();
|
| | | return;
|
| | | }
|
| | | //刷新控件状态
|
| | |
| | | //从房间中移除
|
| | | HdlRoomLogic.Current.DeleteDevice(i_device);
|
| | | }
|
| | | this.RemoveFromParent();
|
| | | //回调控件被移除的事件
|
| | | this.RowNeedRemoveEvent?.Invoke();
|
| | | this.RemoveFromParent();
|
| | | };
|
| | | };
|
| | | }
|
| | |
| | | this.btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(i_device);
|
| | | //检测设备是否是打开状态
|
| | | bool isOpen = this.CheckIsOpenStatu(i_device);
|
| | | if (this.isHadOpenSwitch == true && i_device.HadReadDeviceStatu == false)
|
| | | {
|
| | | //如果这个卡片有开关功能,并且网关还没有回复之前,默认是关闭状态
|
| | | //等待网关回复后会重新刷新,不然一直是关闭状态
|
| | | isOpen = false;
|
| | | }
|
| | | this.SetRowOpenStatu(isOpen);
|
| | | }
|
| | |
|
| | |
| | | //已经取消的收藏
|
| | | if (HdlRoomLogic.Current.IsCollectInRoom(device) == false)
|
| | | {
|
| | | //回调控件被移除的事件
|
| | | this.RowNeedRemoveEvent?.Invoke();
|
| | | //移除这个控件
|
| | | this.RemoveFromParent();
|
| | | return;
|
| | |
| | | var nowRoom = HdlRoomLogic.Current.GetRoomByDevice(device);
|
| | | if (nowRoom == null || nowRoom.Id != HdlRoomLogic.Current.CurrentRoom.Id)
|
| | | {
|
| | | //回调控件被移除的事件
|
| | | this.RowNeedRemoveEvent?.Invoke();
|
| | | //移除这个控件
|
| | | this.RemoveFromParent();
|
| | | return;
|