黄学彪
2020-12-17 9f326f4000847e6167d8166fa2f6a66f53cb3734
ZigbeeApp/Shared/Phone/Device/CommonForm/LeftIconButtonRow.cs
@@ -2,7 +2,7 @@
using Shared.Common;
namespace Shared.Phone.Device.CommonForm
{
    public class LeftIconButtonRow:FrameLayout
    public class LeftIconButtonRow: FrameLayout
    {
        #region ◆ 变量__________________________
        /// <summary>
@@ -17,6 +17,10 @@
        /// 下划线
        /// </summary>
        public FrameLayout Line;
        /// <summary>
        /// 点击事件
        /// </summary>
        public Action<LeftIconButtonRow, MouseEventArgs> ButtonClickEvent;
        /// <summary>
        /// ClickBtn
        /// </summary>
@@ -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;
@@ -66,8 +70,8 @@
            IconButton = new Button()
            {
                X = Application.GetRealWidth(80),
                Height = Application.GetMinRealAverage(80),
                Width = Application.GetMinRealAverage(80),
                Height = HdlControlLogic.Current.GetPictrueRealSize(80),
                Width = HdlControlLogic.Current.GetPictrueRealSize(80),
                UnSelectedImagePath = iconPath,
                SelectedImagePath = iconSelectedPath,
                Gravity = Gravity.CenterVertical,
@@ -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
    }
}