From 404cdc88627f942df7944af04ee05b9d527752d6 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 30 九月 2019 13:22:40 +0800 Subject: [PATCH] 合并了徐梅的按键面板绑定 --- ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs | 216 +++++++++++++++++++++++++---------------------------- 1 files changed, 101 insertions(+), 115 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs old mode 100644 new mode 100755 index c5377a2..9d85f19 --- a/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/DeviceTarget.cs @@ -11,13 +11,13 @@ public class DeviceTarget : FrameLayout { - public DeviceTarget() + public DeviceTarget () { Tag = "Logic"; } - public void Show() + public void Show () { - + this.BackgroundColor = ZigbeeColor.Current.LogicTopViewBackgroundColor; var topFrameLayout = new FrameLayout @@ -28,65 +28,60 @@ AddChidren(topFrameLayout); - var titleName = new Button - { + var titleName = new Button { //Text = "娣诲姞鎵ц鐩爣", - TextID = MyInternationalizationString.addImplementationgoals, + //TextID = MyInternationalizationString.addImplementationgoals, TextSize = 17, TextColor = ZigbeeColor.Current.LogicTextBlackColor, }; - topFrameLayout.AddChidren(titleName); + topFrameLayout.AddChidren (titleName); - var back = new Button - { - Width = Application.GetRealWidth(110), - Height = Application.GetRealHeight(110), - X = Application.GetRealWidth(20), + var back = new Button { + Width = Application.GetRealWidth (110), + Height = Application.GetRealHeight (110), + X = Application.GetRealWidth (20), Gravity = Gravity.CenterVertical, UnSelectedImagePath = "ZigeeLogic/Back.png", }; - topFrameLayout.AddChidren(back); + topFrameLayout.AddChidren (back); back.MouseDownEventHandler += (sender, e) => { - RemoveFromParent(); + RemoveFromParent (); }; - - var middle = new VerticalScrolViewLayout(); + + var middle = new VerticalScrolViewLayout (); middle.Y = topFrameLayout.Bottom; middle.Height = Application.GetRealHeight(1920 - 220); middle.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor; this.AddChidren(middle); - #region ----- 璁惧------ var deviceRowLayout = new RowLayout { Height = Application.GetRealHeight(180), //BackgroundColor = 0xff323232, }; - middle.AddChidren(deviceRowLayout); + middle.AddChidren (deviceRowLayout); - var device = new Button - { - Width = Application.GetRealWidth(400), + var device = new Button { + Width = Application.GetRealWidth (400), TextID = MyInternationalizationString.device, //Text = "璁惧", TextSize = 16, TextAlignment = TextAlignment.CenterLeft, - X = Application.GetRealWidth(40), + X = Application.GetRealWidth (40), TextColor = ZigbeeColor.Current.LogicTextBlackColor, }; - deviceRowLayout.AddChidren(device); + deviceRowLayout.AddChidren (device); - var btndeviceback = new Button - { - Width = Application.GetRealWidth(110), - Height = Application.GetRealHeight(110), + var btndeviceback = new Button { + Width = Application.GetRealWidth (110), + Height = Application.GetRealHeight (110), UnSelectedImagePath = "ZigeeLogic/next.png", SelectedImagePath = "ZigeeLogic/NextSelecte.png", - X = Application.GetRealWidth(1080 - 140),//550 + X = Application.GetRealWidth (1080-140),//550 Gravity = Gravity.CenterVertical, }; - deviceRowLayout.AddChidren(btndeviceback); + deviceRowLayout.AddChidren (btndeviceback); EventHandler<MouseEventArgs> deviceclick = (sender, e) => { Common.Logic.LogicDviceList.Clear(); @@ -100,116 +95,64 @@ logicDevicePage.Show(); }; - deviceRowLayout.MouseUpEventHandler += deviceclick; - device.MouseUpEventHandler += deviceclick; - btndeviceback.MouseUpEventHandler += deviceclick; - #endregion + deviceRowLayout.MouseUpEventHandler += deviceclick; + device.MouseUpEventHandler += deviceclick; + btndeviceback.MouseUpEventHandler += deviceclick; - #region ----- 鍦烘櫙------ - var sceneRowLayout = new RowLayout - { - Height = Application.GetRealHeight(180), + var sceneRowLayout = new RowLayout { + Height = Application.GetRealHeight (180), //BackgroundColor = 0xff323232, - Y = deviceRowLayout.Bottom, + Y=deviceRowLayout.Bottom, }; - middle.AddChidren(sceneRowLayout); + middle.AddChidren (sceneRowLayout); - var scene = new Button - { - Width = Application.GetRealWidth(400), + var scene = new Button { + Width = Application.GetRealWidth (400), TextID = MyInternationalizationString.scene, //Text = "鍦烘櫙", TextSize = 16, TextAlignment = TextAlignment.CenterLeft, - X = Application.GetRealWidth(40), + X = Application.GetRealWidth (40), TextColor = ZigbeeColor.Current.LogicTextBlackColor, }; - sceneRowLayout.AddChidren(scene); + sceneRowLayout.AddChidren (scene); - var btnsceneback = new Button - { - Width = Application.GetRealWidth(110), - Height = Application.GetRealHeight(110), + var btnsceneback = new Button { + Width = Application.GetRealWidth (110), + Height = Application.GetRealHeight (110), UnSelectedImagePath = "ZigeeLogic/next.png", SelectedImagePath = "ZigeeLogic/NextSelecte.png", - X = Application.GetRealWidth(1080 - 140),//550 + X = Application.GetRealWidth (1080-140),//550 Gravity = Gravity.CenterVertical, }; - sceneRowLayout.AddChidren(btnsceneback); + sceneRowLayout.AddChidren (btnsceneback); EventHandler<MouseEventArgs> sceneclick = (sender, e) => { - CommonPage.Loading.Start(); - System.Threading.Tasks.Task.Run(() => { - Application.RunOnMainThread(() => { - CommonPage.Loading.Hide(); - var addScenePage = new AddScenePage(); - UserView.HomePage.Instance.AddChidren(addScenePage); + CommonPage.Loading.Start (); + System.Threading.Tasks.Task.Run (() => { + Application.RunOnMainThread (() => { + CommonPage.Loading.Hide (); + var addScenePage = new AddScenePage (); + UserView.HomePage.Instance.AddChidren (addScenePage); UserView.HomePage.Instance.PageIndex += 1; - addScenePage.Show(); + addScenePage.Show (); }); }); }; - sceneRowLayout.MouseUpEventHandler += sceneclick; - scene.MouseUpEventHandler += sceneclick; - btnsceneback.MouseUpEventHandler += sceneclick; - #endregion + sceneRowLayout.MouseUpEventHandler += sceneclick; + scene.MouseUpEventHandler += sceneclick; + btnsceneback.MouseUpEventHandler += sceneclick; - #region ----- 瀹夐槻妯″紡------ - ///瀹夐槻妯″紡 - var securityRowLayout = new RowLayout - { - Height = Application.GetRealHeight(180), - //BackgroundColor = 0xff323232, - Y = sceneRowLayout.Bottom, - }; - middle.AddChidren(securityRowLayout); - - var security = new Button - { - Width = Application.GetRealWidth(400), - TextID = MyInternationalizationString.securitymode, - //Text = "瀹夐槻妯″紡", - TextSize = 16, - TextAlignment = TextAlignment.CenterLeft, - X = Application.GetRealWidth(40), - TextColor = ZigbeeColor.Current.LogicTextBlackColor, - }; - securityRowLayout.AddChidren(security); - - var btnsecurityback = new Button - { - Width = Application.GetRealWidth(110), - Height = Application.GetRealHeight(110), - UnSelectedImagePath = "ZigeeLogic/next.png", - SelectedImagePath = "ZigeeLogic/NextSelecte.png", - X = Application.GetRealWidth(1080 - 140),//550 - Gravity = Gravity.CenterVertical, - }; - securityRowLayout.AddChidren(btnsecurityback); - - EventHandler<MouseEventArgs> securityclick = (sender, e) => { - var securityMode = new SecurityMode(); - UserView.HomePage.Instance.AddChidren(securityMode); - UserView.HomePage.Instance.PageIndex += 1; - securityMode.Show(); - }; - - securityRowLayout.MouseUpEventHandler += securityclick; - security.MouseUpEventHandler += securityclick; - btnsecurityback.MouseUpEventHandler += securityclick; - #endregion - - #region ----- 宸叉湁鑷姩鍖�------ ///宸叉湁鑷姩鍖� var existenceRowLayout = new RowLayout { Height = Application.GetRealHeight(180), //BackgroundColor = 0xff323232, - Y = securityRowLayout.Bottom, + Y = sceneRowLayout.Bottom, }; - //middle.AddChidren(existenceRowLayout); + middle.AddChidren(existenceRowLayout); var existence = new Button { @@ -244,16 +187,59 @@ existenceRowLayout.MouseUpEventHandler += existenceclick; existence.MouseUpEventHandler += existenceclick; btnexistenceback.MouseUpEventHandler += existenceclick; - #endregion - #region ----- 寤舵椂------ + ///瀹夐槻妯″紡 + var securityRowLayout = new RowLayout + { + Height = Application.GetRealHeight(180), + //BackgroundColor = 0xff323232, + Y = existenceRowLayout.Bottom, + }; + middle.AddChidren(securityRowLayout); + + var security = new Button + { + Width = Application.GetRealWidth(400), + TextID = MyInternationalizationString.securitymode, + //Text = "瀹夐槻妯″紡", + TextSize = 16, + TextAlignment = TextAlignment.CenterLeft, + X = Application.GetRealWidth(40), + TextColor = ZigbeeColor.Current.LogicTextBlackColor, + }; + securityRowLayout.AddChidren(security); + + var btnsecurityback = new Button + { + Width = Application.GetRealWidth(110), + Height = Application.GetRealHeight(110), + UnSelectedImagePath = "ZigeeLogic/next.png", + SelectedImagePath = "ZigeeLogic/NextSelecte.png", + X = Application.GetRealWidth(1080 - 140),//550 + Gravity = Gravity.CenterVertical, + }; + securityRowLayout.AddChidren(btnsecurityback); + + EventHandler<MouseEventArgs>securityclick = (sender, e) => { + var securityMode = new SecurityMode(); + UserView.HomePage.Instance.AddChidren(securityMode); + UserView.HomePage.Instance.PageIndex += 1; + securityMode.Show(); + }; + + securityRowLayout.MouseUpEventHandler += securityclick; + security.MouseUpEventHandler += securityclick; + btnsecurityback.MouseUpEventHandler += securityclick; + + + var delayedRowLayout = new RowLayout { Height = Application.GetRealHeight(180), //BackgroundColor = 0xff323232, - Y = securityRowLayout.Bottom, + Y=securityRowLayout.Bottom, }; - //middle.AddChidren(delayedRowLayout); + middle.AddChidren(delayedRowLayout); var delayed = new Button { @@ -290,10 +276,10 @@ delayedRowLayout.MouseUpEventHandler += delayedclick; delayed.MouseUpEventHandler += delayedclick; btndelayedback.MouseUpEventHandler += delayedclick; - #endregion + } - public static void DelayTimeView(Dictionary<string, object> delayactionsInfo = null) + public static void DelayTimeView(Dictionary<string, object> delayactionsInfo=null) { var listValues = new List<string>(); for (int i = 0; i < 60; i++) -- Gitblit v1.8.0