黄学彪
2020-09-22 ade5917841b0fdcb1df7353ef7c56b1a1bdc9282
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Common/ClickButtonCommon.cs
@@ -16,9 +16,13 @@
        /// </summary>
        public bool UseClickStatu = true;
        /// <summary>
        /// 原来的背景色(迫不得己,这个东西需要开放出去)
        /// 原来的背景色(迫不得己,这个东西需要开放出去,设置一次之后将不会再设置)
        /// </summary>
        public uint oldBackgroundColor = 0;
        /// <summary>
        /// 点击状态的背景色(迫不得己,这个东西需要开放出去,默认使用底层设置的)
        /// </summary>
        public uint clickStatuColor = UserCenterColor.Current.ButtonClickStatuColor;
        /// <summary>
        /// 是否处于选择状态
        /// </summary>
@@ -37,7 +41,7 @@
            this.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor;
            this.TextAlignment = TextAlignment.Center;
            this.MouseDownEventHandler += this.Button_MouseDownEvent;
            this.ButtonDownClickEvent += this.Button_MouseDownEvent;
        }
        #endregion
@@ -54,7 +58,7 @@
            if (this.UseClickStatu == false)
            {
                //永久移除
                this.MouseDownEventHandler -= this.Button_MouseDownEvent;
                this.ButtonDownClickEvent -= Button_MouseDownEvent;
                return;
            }
            if (base.CanClick == false || isSelcetStatu == true)
@@ -62,11 +66,14 @@
                //控件不能点击,或者当前处于选择状态,则不能触发
                return;
            }
            if (this.oldBackgroundColor == 0)
            {
                this.oldBackgroundColor = this.BackgroundColor;
            }
            //设置点击后的状态
            this.SetClickStatu();
            new System.Threading.Thread(() =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                System.Threading.Thread.Sleep(ControlCommonResourse.StatuChangedWaitTime);
                Application.RunOnMainThread(() =>
@@ -79,8 +86,7 @@
                    //设置非点击后的状态
                    this.SetNotClickStatu();
                });
            })
            { IsBackground = true }.Start();
            });
        }
        /// <summary>
@@ -89,11 +95,7 @@
        public override void SetClickStatu()
        {
            this.isSelcetStatu = true;
            if (this.oldBackgroundColor == 0)
            {
                this.oldBackgroundColor = this.BackgroundColor;
            }
            this.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
            this.BackgroundColor = clickStatuColor;
        }
        /// <summary>
@@ -102,10 +104,6 @@
        public override void SetNotClickStatu()
        {
            this.isSelcetStatu = false;
            if (this.oldBackgroundColor == 0)
            {
                this.oldBackgroundColor = this.BackgroundColor;
            }
            //设置不选择状态
            this.BackgroundColor = oldBackgroundColor;
        }