| | |
| | | /// </summary> |
| | | public bool UseClickStatu = true;
|
| | | /// <summary>
|
| | | /// 原来的背景色(迫不得己,这个东西需要开放出去)
|
| | | /// 原来的背景色(迫不得己,这个东西需要开放出去,设置一次之后将不会再设置)
|
| | | /// </summary> |
| | | public uint oldBackgroundColor = 0;
|
| | | /// <summary>
|
| | | /// 点击状态的背景色(迫不得己,这个东西需要开放出去,默认使用底层设置的)
|
| | | /// </summary>
|
| | | public uint clickStatuColor = UserCenterColor.Current.ButtonClickStatuColor;
|
| | | /// <summary>
|
| | | /// 是否处于选择状态
|
| | | /// </summary>
|
| | |
| | | this.BackgroundColor = UserCenterColor.Current.ClickButtonDefultColor; |
| | | this.TextAlignment = TextAlignment.Center;
|
| | |
|
| | | this.MouseDownEventHandler += this.Button_MouseDownEvent;
|
| | | this.ButtonDownClickEvent += this.Button_MouseDownEvent;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | if (this.UseClickStatu == false)
|
| | | {
|
| | | //永久移除
|
| | | this.MouseDownEventHandler -= this.Button_MouseDownEvent;
|
| | | this.ButtonDownClickEvent -= Button_MouseDownEvent;
|
| | | return;
|
| | | }
|
| | | if (base.CanClick == false || isSelcetStatu == true)
|
| | |
| | | //控件不能点击,或者当前处于选择状态,则不能触发
|
| | | 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(() =>
|
| | |
| | | //设置非点击后的状态
|
| | | this.SetNotClickStatu();
|
| | | });
|
| | | })
|
| | | { IsBackground = true }.Start();
|
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | public override void SetClickStatu()
|
| | | {
|
| | | this.isSelcetStatu = true;
|
| | | if (this.oldBackgroundColor == 0)
|
| | | {
|
| | | this.oldBackgroundColor = this.BackgroundColor;
|
| | | }
|
| | | this.BackgroundColor = UserCenterColor.Current.ButtonClickStatuColor;
|
| | | this.BackgroundColor = clickStatuColor;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | public override void SetNotClickStatu()
|
| | | {
|
| | | this.isSelcetStatu = false;
|
| | | if (this.oldBackgroundColor == 0)
|
| | | {
|
| | | this.oldBackgroundColor = this.BackgroundColor;
|
| | | }
|
| | | //设置不选择状态
|
| | | this.BackgroundColor = oldBackgroundColor;
|
| | | }
|