From f718d23a262a5a8e1241fdeaeb4153399f95e79d Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 21 四月 2020 09:19:05 +0800 Subject: [PATCH] 20200421 --- HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs | 175 ++++++++++----------------------------------------------- 1 files changed, 32 insertions(+), 143 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs index d24c8a6..6c3064a 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/FunctionBaseInfoSetPage.cs @@ -9,18 +9,38 @@ { #region 鎺т欢鍒楄〃 FrameLayout bodyView; - + /// <summary> + /// 鍔熻兘鍚嶇О鏄剧ず鎸夐挳 + /// </summary> + Button btnFunctionName; + /// <summary> + /// 鍔熻兘鍚嶇О缂栬緫鎸夐挳 + /// </summary> + Button btnEditName; + /// <summary> + /// 浣嶇疆淇℃伅鏄剧ず鎸夐挳 + /// </summary> + Button btnLocationValues; + /// <summary> + /// 浣嶇疆淇℃伅璺宠浆缂栬緫鎸夐挳 + /// </summary> + Button btnLocationInfoRight; #endregion #region 灞�閮ㄥ彉閲� Function function; + /// <summary> + /// 鍚庨��鏃讹紝鍒锋柊涔嬪墠鐣岄潰鐨勬樉绀轰俊鎭� + /// </summary> + Action actionRefresh; #endregion - public FunctionBaseInfoSetPage(Function func) + public FunctionBaseInfoSetPage(Function func,Action action) { bodyView = this; function = func; + actionRefresh = action; } /// <summary> /// 鍔犺浇鐣岄潰 @@ -28,7 +48,7 @@ public void LoadPage() { bodyView.BackgroundColor = CSS_Color.BackgroundColor; - new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Setting)); + new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView(actionRefresh); #region name view var nameView = new FrameLayout() @@ -50,7 +70,7 @@ }; nameView.AddChidren(btnNameText); - var btnNameValues = new Button() + btnFunctionName = new Button() { X = Application.GetRealWidth(186), Width = Application.GetRealWidth(137), @@ -59,9 +79,9 @@ TextSize = CSS_FontSize.TextFontSize, Text = function.name, }; - nameView.AddChidren(btnNameValues); + nameView.AddChidren(btnFunctionName); - var btnEditName = new Button() + btnEditName = new Button() { X = Application.GetRealWidth(333), Gravity = Gravity.CenterVertical, @@ -81,11 +101,6 @@ Height = Application.GetRealHeight(1) }); - btnEditName.MouseUpEventHandler += (sender, e) => { - LoadEditFunctionNameView(); - }; - - #endregion #region 浣嶇疆绠$悊 @@ -97,7 +112,7 @@ }; bodyView.AddChidren(locationMagtView); - var btnLocationMagtText = new Button() + var btnLocationMagtTitle = new Button() { X = Application.GetRealWidth(16), Width = Application.GetRealWidth(160), @@ -106,9 +121,9 @@ TextSize = CSS_FontSize.SubheadingFontSize, TextID = StringId.LocationManagement, }; - locationMagtView.AddChidren(btnLocationMagtText); + locationMagtView.AddChidren(btnLocationMagtTitle); - var btnLocationValues = new Button() + btnLocationValues = new Button() { X = Application.GetRealWidth(186), Width = Application.GetRealWidth(137), @@ -119,7 +134,7 @@ }; locationMagtView.AddChidren(btnLocationValues); - var btnLocationMagtRight = new Button() + btnLocationInfoRight = new Button() { X = Application.GetRealWidth(339), Gravity = Gravity.CenterVertical, @@ -127,7 +142,7 @@ Height = Application.GetMinRealAverage(16), UnSelectedImagePath = "Public/RightIcon.png", }; - locationMagtView.AddChidren(btnLocationMagtRight); + locationMagtView.AddChidren(btnLocationInfoRight); locationMagtView.AddChidren( new Button() @@ -138,10 +153,6 @@ Width = Application.GetRealWidth(343), Height = Application.GetRealHeight(1) }); - btnLocationMagtRight.MouseUpEventHandler += (sender, e) => - { - SkipChooseRoomPage(); - }; #endregion #region 鍏变韩 @@ -218,131 +229,9 @@ #endregion - + LoadEventList(); } - - - void LoadEditFunctionNameView() - { - Dialog dialog = new Dialog() - { - BackgroundColor = 0x99000000, - }; - - FrameLayout dialogView = new FrameLayout() - { - Gravity = Gravity.Center, - Width = Application.GetRealWidth(270), - Height = Application.GetRealHeight(172), - BackgroundColor = CSS.CSS_Color.MainBackgroundColor, - BorderColor = 0x00000000, - BorderWidth = 0, - Radius = (uint)Application.GetMinRealAverage(10), - }; - dialog.AddChidren(dialogView); - - Button btnTitle = new Button() - { - Y = Application.GetRealHeight(10), - Height = Application.GetRealHeight(42), - TextColor = CSS.CSS_Color.MainColor, - TextSize = CSS.CSS_FontSize.SubheadingFontSize, - TextAlignment = TextAlignment.Center, - IsBold = true, - TextID = StringId.ChangeName, - }; - dialogView.AddChidren(btnTitle); - - FrameLayout editView = new FrameLayout() - { - Gravity = Gravity.CenterHorizontal, - Y = btnTitle.Bottom + Application.GetRealHeight(6), - Width = Application.GetRealWidth(222), - Height = Application.GetRealHeight(44), - BackgroundColor = CSS.CSS_Color.BackgroundColor, - BorderColor = 0x00000000, - BorderWidth = 0, - Radius = (uint)Application.GetMinRealAverage(4), - }; - dialogView.AddChidren(editView); - - EditText etName = new EditText() - { - X = Application.GetRealWidth(12), - Width = Application.GetRealWidth(182), - Text = function.name, - TextColor = CSS.CSS_Color.FirstLevelTitleColor, - TextSize = CSS.CSS_FontSize.TextFontSize, - }; - editView.AddChidren(etName); - - Button btnLine = new Button() - { - Y = Application.GetRealHeight(128), - Height = Application.GetRealHeight(1), - BackgroundColor = CSS.CSS_Color.DividingLineColor, - }; - dialogView.AddChidren(btnLine); - - Button btnCancel = new Button() - { - Y = btnLine.Bottom, - Width = Application.GetRealWidth(134), - Height = Application.GetRealHeight(43), - TextAlignment = TextAlignment.Center, - TextColor = CSS.CSS_Color.TextualColor, - TextSize = CSS_FontSize.SubheadingFontSize, - SelectedTextColor = CSS_Color.MainBackgroundColor, - SelectedBackgroundColor = CSS_Color.MainColor, - TextID = StringId.Cancel, - }; - dialogView.AddChidren(btnCancel); - - Button btnBottomLine = new Button() - { - X = btnCancel.Right, - Y = btnLine.Bottom, - Height = Application.GetRealHeight(43), - Width = Application.GetRealWidth(1), - BackgroundColor = CSS_Color.DividingLineColor, - }; - dialogView.AddChidren(btnBottomLine); - - Button btnConfirm = new Button() - { - X = btnBottomLine.Right, - Y = btnLine.Bottom, - Width = Application.GetRealWidth(135), - Height = Application.GetRealHeight(43), - TextAlignment = TextAlignment.Center, - TextColor = CSS.CSS_Color.TextualColor, - TextSize = CSS_FontSize.SubheadingFontSize, - SelectedTextColor = CSS_Color.MainBackgroundColor, - SelectedBackgroundColor = CSS_Color.MainColor, - TextID = StringId.Confirm, - }; - dialogView.AddChidren(btnConfirm); - - dialog.Show(); - - btnCancel.MouseDownEventHandler += (sender, e) => { - btnCancel.IsSelected = true; - }; - btnCancel.MouseUpEventHandler += (sender, e) => { - btnCancel.IsSelected = false; - dialog.Close(); - }; - btnConfirm.MouseDownEventHandler += (sender, e) => { - btnConfirm.IsSelected = true; - }; - btnConfirm.MouseUpEventHandler += (sender, e) => { - btnConfirm.IsSelected = false; - function.name = etName.Text.Trim(); - DB_ResidenceData.residenceData.SaveResidenceData(); - dialog.Close(); - }; - } } } -- Gitblit v1.8.0