From 72be4f06a683de33ddd563c8447c39f7f17e5b7d Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 06 一月 2020 13:03:50 +0800 Subject: [PATCH] 合并代码 --- ZigbeeApp/Shared/Phone/Device/CommonForm/LeftIconButtonRow.cs | 42 ++++++++++++++++++++++++++++++++++++------ 1 files changed, 36 insertions(+), 6 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/CommonForm/LeftIconButtonRow.cs b/ZigbeeApp/Shared/Phone/Device/CommonForm/LeftIconButtonRow.cs index b009368..ac65aa1 100755 --- a/ZigbeeApp/Shared/Phone/Device/CommonForm/LeftIconButtonRow.cs +++ b/ZigbeeApp/Shared/Phone/Device/CommonForm/LeftIconButtonRow.cs @@ -18,6 +18,10 @@ /// </summary> public FrameLayout Line; /// <summary> + /// 鐐瑰嚮浜嬩欢 + /// </summary> + public Action<LeftIconButtonRow, MouseEventArgs> ButtonClickEvent; + /// <summary> /// ClickBtn /// </summary> public Button ClickBtn; @@ -45,7 +49,7 @@ #endregion - public LeftIconButtonRow(int width,int height, int x = 0, int y = 0) + public LeftIconButtonRow(int width = 449, int height = 150, int x = 0, int y = 0) { X = x; Y = y; @@ -103,9 +107,8 @@ AddChidren(Line); } - ClickBtn = new Button { Tag = this.Tag }; - AddChidren(ClickBtn); - + IconButton.MouseUpEventHandler += Button_MouseUpEventHandler; + TitleButton.MouseUpEventHandler += Button_MouseUpEventHandler; } #endregion @@ -115,12 +118,11 @@ /// 璁剧疆鐘舵�� /// </summary> /// <param name="statu"></param> - public void SetStatu(bool statu) + private void SetStatu(bool statu) { IconButton.IsSelected = statu; TitleButton.IsSelected = statu; TitleButton.IsBold = statu; - ClickBtn.IsSelected = statu; } /// <summary> /// 閫変腑 @@ -144,7 +146,35 @@ { Line.Visible = !statu; } + /// <summary> + /// 璁剧疆鏍囬棰滆壊 + /// </summary> + /// <param name="color"></param> + /// <param name="selectedColor"></param> + public void SetTitleColor(uint color,uint selectedColor) + { + TitleButton.TextColor = color; + TitleButton.SelectedTextColor = selectedColor; + } + #endregion + #region 鈼� 鐐瑰嚮浜嬩欢_________________________ + + /// <summary> + /// 鐐瑰嚮浜嬩欢 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void Button_MouseUpEventHandler(object sender, MouseEventArgs e) + { + try + { + this.ButtonClickEvent?.Invoke(this, e); + } + catch (Exception ex) + { + } + } #endregion } } -- Gitblit v1.8.0