黄学彪
2019-11-25 5727cf0b9b54da0a191dd1e23cb5abf21320fbff
ZigbeeApp/Shared/Phone/Device/CommonForm/SelectedStatuButton.cs
old mode 100644 new mode 100755
@@ -15,11 +15,14 @@
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Shared.SelectedStatuButton"/> class.
        /// </summary>
        public SelectedStatuButton()
        public SelectedStatuButton(uint textColor = 0xFF666666, uint selectedTextColor = 0xFF000000)
        {
            MouseDownEventHandler += Button_MouseDownEvent;
            SelectedTextColor = ZigbeeColor.Current.GXCTextBlueColor;
            TextColor = textColor;
            SelectedTextColor = selectedTextColor;
        }
        /// <summary>
        /// 单击按下,实现短暂点亮选中效果
        /// </summary>
@@ -27,13 +30,19 @@
        /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
        private void Button_MouseDownEvent(object sender, MouseEventArgs mouseEventArgs)
        {
            bool statu = IsSelected;
            SetSeletedStatu();
            new System.Threading.Thread(() =>
            {
                System.Threading.Thread.Sleep(SelectedStatuTime);
                SetUnSelectedStatu();
                Application.RunOnMainThread(() =>
                {
                    IsSelected = statu;
                });
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 设置选中状态