using System; using System.Collections.Generic; using HDL_ON.UI.UI2.Intelligence.Automation.LogicView; using Shared; namespace HDL_ON.UI.UI2.PersonalCenter.PirDevice { public class AddControlComplete : FrameLayout { public AddControlComplete() { Tag = "Pir"; } public void Show(Control control, bool bool_library) { #region 界面布局 this.BackgroundColor = CSS.CSS_Color.viewMiddle; PirDevice.View.TopView topView = new View.TopView(); topView.topNameBtn.TextID = StringId.tianjiayaokongqi; this.AddChidren(topView.FLayoutView()); topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent(); }; FrameLayout fLayout = new FrameLayout { Y = Application.GetRealHeight(64), BackgroundColor = CSS.CSS_Color.textWhiteColor, Height = Application.GetRealHeight(224), Width = Application.GetRealWidth(375), }; this.AddChidren(fLayout); // Button iconBtn = new Button { Y = Application.GetRealHeight(28), X = Application.GetRealWidth(137), Width = Application.GetRealWidth(102), Height = Application.GetRealWidth(102), UnSelectedImagePath = "PirIcon/succeed.png", }; fLayout.AddChidren(iconBtn); //添加成功 Button text1Btn = new Button { Width = Application.GetRealWidth(375 - 32), Height = Application.GetRealHeight(22), Y = Application.GetRealHeight(158), X = Application.GetRealWidth(16), TextID = StringId.tianjiachenggong, TextSize = TextSize.text16, TextColor = CSS.CSS_Color.btnSaveBackgroundColor, TextAlignment = TextAlignment.Center, }; fLayout.AddChidren(text1Btn); //可到分类-功能-电器操作使用 Button text2Btn = new Button { Width = Application.GetRealWidth(375 - 32), Height = Application.GetRealHeight(22), Y = Application.GetRealHeight(188), X = Application.GetRealWidth(16), TextID = StringId.kedaofenlei, TextSize = TextSize.text14, TextColor = CSS.CSS_Color.textTipColor, TextAlignment = TextAlignment.Center, }; fLayout.AddChidren(text2Btn); //所属分类 View.PatchView fenlei = new View.PatchView(); fenlei.frameLayout.Y = fLayout.Bottom + Application.GetRealHeight(8); this.AddChidren(fenlei.FLayoutView(false)); fenlei.btnText1.TextID = StringId.suoshufenlei; fenlei.btnText2.TextID = StringId.dianqi; //遥控器名称 View.PatchView namePatchView = new View.PatchView(); namePatchView.frameLayout.Y = fenlei.frameLayout.Bottom; this.AddChidren(namePatchView.FLayoutView()); namePatchView.btnText1.TextID = StringId.yaokongqimingcheng; namePatchView.btnText2.Text = control.name; //所属区域 View.PatchView quyuPatchView = new View.PatchView(); quyuPatchView.frameLayout.Y = namePatchView.frameLayout.Bottom; this.AddChidren(quyuPatchView.FLayoutView()); quyuPatchView.btnText1.TextID = StringId.suoshuquyu; quyuPatchView.btnText2.TextID = StringId.dianqi; //继续添加 Button addBtn = new Button { Y = quyuPatchView.frameLayout.Bottom + Application.GetRealHeight(125), X = Application.GetRealWidth(16), Width = Application.GetRealWidth(375 - 32), Height = Application.GetRealHeight(20), TextID = StringId.jixutianjia, TextSize = TextSize.text14, TextColor = CSS.CSS_Color.textConfirmColor, TextAlignment = TextAlignment.Center, }; this.AddChidren(addBtn); //完成 View.SaveView saveView = new View.SaveView(); this.AddChidren(saveView.FLayoutView()); saveView.frameLayout.SetCornerWithSameRadius(Application.GetRealHeight(24), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); #endregion #region 界面点击事件 //遥控器名称点击事件 namePatchView.btnClick.MouseUpEventHandler += (sender, e) => { }; //所属区域点击事件 quyuPatchView.btnClick.MouseUpEventHandler += (sender, e) => { }; //继续添加点击事件 addBtn.MouseUpEventHandler += (sender, e) => { if (bool_library) { this.RemoveFromParent(); } else { Method method = new Method(); method.AddControl(this, (control1) => { AddButton addButton = new AddButton(); MainPage.BasePageView.AddChidren(addButton); addButton.Show(control1); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }); } }; //完成点击事件 saveView.btnClick.MouseUpEventHandler += (sender, e) => { MainPage.BasePageView.RemoveViewByTag("AddControl"); MainPage.BasePageView.RemoveViewByTag("Pir"); }; #endregion } } }