| | |
| | | /// </summary> |
| | | private Button btnRoomName; |
| | | /// <summary> |
| | | /// 上一级界面的收藏控件 |
| | | /// </summary> |
| | | private Button btnCollectionIcon; |
| | | |
| | | /// <summary> |
| | | /// 头部布局 |
| | | /// </summary> |
| | | private TopView topView; |
| | |
| | | /// </summary> |
| | | /// <param name="function">设备</param> |
| | | /// <param name="btnDeviceName">上一级界面的设备名字控件(注:不能传null,没有可以传new Button())</param> |
| | | /// <param name="btnRoomName">上一级界面的房间名字控件(注:不能传null,没有可以传new Button())</param> |
| | | public HisenseTvPage(Function function, Button btnDeviceName, Button btnRoomName, CommonMethod.Comerom comerom, Action action) |
| | | /// <param name="btnRoomName">上一级界面的房间名字控件(注:不能传null,没有可以传new Button())</param> |
| | | /// <param name="btnCollectionIcon">上一级界面的房间名字控件(注:不能传null,没有可以传new Button())</param> |
| | | public HisenseTvPage(Function function, Button btnDeviceName, Button btnRoomName, Button btnCollectionIcon, CommonMethod.Comerom comerom, Action action) |
| | | { |
| | | this.device = function; |
| | | this.btnDeviceName = btnDeviceName; |
| | | this.btnRoomName = btnRoomName; |
| | | this.btnCollectionIcon = btnCollectionIcon; |
| | | this.comerom = comerom; |
| | | this.action = action; |
| | | |
| | |
| | | { |
| | | btnOpenCollectIcon.IsSelected = this.device.collect = !btnOpenCollectIcon.IsSelected; |
| | | this.device.CollectFunction(); |
| | | btnCloseCollectIcon.IsSelected = btnOpenCollectIcon.IsSelected; |
| | | this.btnCollectionIcon.IsSelected = btnOpenCollectIcon.IsSelected; |
| | | }; |
| | | |
| | | //首页 |
| | |
| | | //关机 |
| | | kaiguanFL.SetClickListener((fl, btnImage, btnText) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "0", (isBool) => |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "off", (isBool) => |
| | | { |
| | | if (isBool) |
| | | { |
| | |
| | | { |
| | | btnCloseCollectIcon.IsSelected = this.device.collect = !btnCloseCollectIcon.IsSelected; |
| | | this.device.CollectFunction(); |
| | | btnOpenCollectIcon.IsSelected = btnCloseCollectIcon.IsSelected; |
| | | this.btnCollectionIcon.IsSelected = btnCloseCollectIcon.IsSelected; |
| | | }; |
| | | //开机 |
| | | clickBtn.MouseDownEventHandler += (sen, e) => |
| | | { |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "1", (isBool) => |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "on", (isBool) => |
| | | { |
| | | if (isBool) |
| | | { |
| | |
| | | catch { } |
| | | } |
| | | /// <summary> |
| | | /// 初始数据 |
| | | /// 初始化数据 |
| | | /// </summary> |
| | | private void ReadData() |
| | | { |
| | |
| | | this.AddChidren(topView.TopFLayoutView()); |
| | | } |
| | | /// <summary> |
| | | /// 根据设备开关状态显示指定显示界面 |
| | | /// 根据设备开关状态显示指定界面 |
| | | /// (进来的时候用到) |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private void CurrentAssignPage() |
| | | { |
| | | CommonMethod.Current.MainThread(() => |
| | | { |
| | | |
| | | if (this.device == null) |
| | | { |
| | | vv.Visible = false; |
| | | baseCloseFFL.Visible = true; |
| | | return; |
| | | } |
| | | if (this.device.GetAttrState("on_off") == "on") |
| | | { |
| | | vv.Visible = true; |
| | | baseCloseFFL.Visible = false; |
| | | } |
| | | else |
| | | { |
| | | vv.Visible = false; |
| | | baseCloseFFL.Visible = true; |
| | | } |
| | | if (this.device == null) |
| | | { |
| | | vv.Visible = false; |
| | | baseCloseFFL.Visible = true; |
| | | return; |
| | | } |
| | | if (this.device.GetAttrState("on_off") == "on" || this.device.GetAttrState("on_off") == "1") |
| | | { |
| | | vv.Visible = true; |
| | | baseCloseFFL.Visible = false; |
| | | } |
| | | else |
| | | { |
| | | vv.Visible = false; |
| | | baseCloseFFL.Visible = true; |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | |
| | | { |
| | | EventHandler<MouseEventArgs> DownClick = (sender, e) => |
| | | { |
| | | this.BackgroundColor = 0xFFF2F3F7; |
| | | //this.BackgroundColor = 0xFFF2F3F7; |
| | | action?.Invoke(this, btnImage, btnText); |
| | | }; |
| | | this.MouseDownEventHandler += DownClick; |
| | |
| | | |
| | | EventHandler<MouseEventArgs> UpClick = (sender, e) => |
| | | { |
| | | this.BackgroundColor = 0x00000000; |
| | | //this.BackgroundColor = 0x00000000; |
| | | }; |
| | | this.MouseUpEventHandler += UpClick; |
| | | btnImage.MouseUpEventHandler += UpClick; |