| | |
| | | /// 下划线 |
| | | /// </summary> |
| | | public FrameLayout Line; |
| | | /// <summary>
|
| | | /// 点击事件
|
| | | /// </summary>
|
| | | public Action<LeftIconButtonRow, MouseEventArgs> ButtonClickEvent; |
| | | /// <summary> |
| | | /// ClickBtn |
| | | /// </summary> |
| | | public Button ClickBtn; |
| | | /// <summary> |
| | | /// v_Selected |
| | | /// </summary> |
| | |
| | | |
| | | #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; |
| | |
| | | Text = title, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Gravity = Gravity.CenterVertical, |
| | | Tag = this.Tag |
| | | Tag = this.Tag, |
| | | TextSize=14 |
| | | }; |
| | | AddChidren(TitleButton); |
| | | |
| | |
| | | { |
| | | AddChidren(Line); |
| | | } |
| | | |
| | | IconButton.MouseUpEventHandler += Button_MouseUpEventHandler; |
| | | TitleButton.MouseUpEventHandler += Button_MouseUpEventHandler; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | /// 设置状态 |
| | | /// </summary> |
| | | /// <param name="statu"></param> |
| | | public void SetStatu(bool statu) |
| | | private void SetStatu(bool statu) |
| | | { |
| | | IconButton.IsSelected = statu; |
| | | TitleButton.IsSelected = statu; |
| | | TitleButton.IsBold = statu; |
| | | } |
| | | /// <summary> |
| | | /// 选中 |
| | | /// </summary> |
| | | public void SetSelectedStatu() |
| | | { |
| | | IconButton.IsSelected = true; |
| | | TitleButton.IsSelected = true; |
| | | SetStatu(true); |
| | | } |
| | | /// <summary> |
| | | /// 不选中 |
| | | /// </summary> |
| | | public void SetUnSelectedStatu() |
| | | { |
| | | IconButton.IsSelected = false; |
| | | TitleButton.IsSelected = false; |
| | | SetStatu(false); |
| | | } |
| | | /// <summary> |
| | | /// HidenLine |
| | | /// </summary> |
| | | /// <param name="statu"></param> |
| | | public void HidenLine(bool statu) |
| | | { |
| | | 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 |
| | | } |
| | | } |