From b71dfb3ca100340005d56e1298292807da82322d Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 08 六月 2020 15:04:21 +0800 Subject: [PATCH] 20200608 --- HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs | 95 +++++++++++++++++++++++++++-------------------- 1 files changed, 55 insertions(+), 40 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs index a278200..1544182 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/TVPageBLL.cs @@ -7,30 +7,11 @@ public partial class TVPage { /// <summary> - /// 鏇存柊鐏厜鐘舵�� - /// </summary> - public static void UpdataState(TV uTv) - { - Application.RunOnMainThread(() => - { - try - { - if (bodyView == null) - return; - bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = uTv.on_off == "on"; - } - catch (Exception ex) - { - MainPage.Log($"RelayPage error {ex.Message}"); - } - }); - } - /// <summary> /// 鍔犺浇浜嬩欢鍒楄〃 /// </summary> void LoadEventList() { - LoadSwitchEvent(); + LoadControlEvent(); LoadCollectionEvent(); //鍥為��鍒锋柊淇℃伅浜嬩欢 @@ -52,33 +33,67 @@ } /// <summary> - /// 鍔犺浇寮�鍏充簨浠� + /// 鍔犺浇鎺у埗浜嬩欢 /// </summary> - void LoadSwitchEvent() + void LoadControlEvent() { - btnSwitchIcon.MouseUpEventHandler += (sender, e) => + btnChangeTVAV.MouseUpEventHandler = (sender, e) => { - btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected; - - new System.Threading.Thread(() => - { - tv.on_off = btnSwitch.IsSelected ? "on" : "off"; - Control.Send(CommandType_A.write, this.tv); - }) - { IsBackground = true }.Start(); + tv.ControlTV(InfraredCode_TV.AV_TV); }; - btnSwitch.MouseUpEventHandler += (sender, e) => + btnChlPlus.MouseUpEventHandler = (sender, e) => { - btnSwitch.IsSelected = !btnSwitch.IsSelected; - - new System.Threading.Thread(() => - { - tv.on_off = btnSwitch.IsSelected ? "on" : "off"; - Control.Send(CommandType_A.write, this.tv); - }) - { IsBackground = true }.Start(); + tv.ControlTV(InfraredCode_TV.ChannelUp); + }; + btnChlReduce.MouseUpEventHandler = (sender, e) => + { + tv.ControlTV(InfraredCode_TV.ChannelDown); + }; + btnVolPlus.MouseUpEventHandler = (sender, e) => + { + tv.ControlTV(InfraredCode_TV.VolUp); + }; + btnVolReduce.MouseUpEventHandler = (sender, e) => + { + tv.ControlTV(InfraredCode_TV.VolDown); + }; + btnBack.MouseUpEventHandler = (sender, e) => + { + tv.ControlTV(InfraredCode_TV.Back); }; + btnMenu.MouseUpEventHandler = (sender, e) => + { + tv.ControlTV(InfraredCode_TV.Menu); + }; + btn123.MouseUpEventHandler = (sender, e) => + { + ShowNumberView(); + }; + btnMute.MouseUpEventHandler = (sender, e) => + { + tv.ControlTV(InfraredCode_TV.Mute); + }; + btnPower.MouseUpEventHandler = (sender, e) => + { + tv.ControlTV(InfraredCode_TV.Power); + }; + + btnTopMenuUp.MouseUpEventHandler = (sender, e) => { + tv.ControlTV(InfraredCode_TV.Up); + }; + btnTopMenuLeft.MouseUpEventHandler = (sender, e) => { + tv.ControlTV(InfraredCode_TV.Left); + }; + btnTopMenuRight.MouseUpEventHandler = (sender, e) => { + tv.ControlTV(InfraredCode_TV.Right); + }; + btnTopMenuDown.MouseUpEventHandler = (sender, e) => { + tv.ControlTV(InfraredCode_TV.Down); + }; + btnOk.MouseUpEventHandler = (sender, e) => { + tv.ControlTV(InfraredCode_TV.Confrim); + }; } } -- Gitblit v1.8.0