From 48ba446936b51fffafa7c3600c0dadc6ac0e8c20 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期五, 10 七月 2020 10:52:13 +0800 Subject: [PATCH] 2020-07-10-01 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Common/IconControlCommon.cs | 41 ++++++++++++++++++++++++++--------------- 1 files changed, 26 insertions(+), 15 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Common/IconControlCommon.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Common/IconControlCommon.cs index cebfbe2..f93af7e 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Common/IconControlCommon.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Common/IconControlCommon.cs @@ -26,7 +26,7 @@ public IconControlCommon() { //杩欎釜浜嬩欢鏄悶鐐逛寒鐗规晥鐨� - this.MouseDownEventHandler += this.Button_MouseDownEvent; + this.ButtonDownClickEvent += this.Button_MouseDownEvent; } #endregion @@ -43,7 +43,7 @@ if (this.UseClickStatu == false || string.IsNullOrEmpty(this.SelectedImagePath) == true) { //姘镐箙绉婚櫎 - this.MouseDownEventHandler -= this.Button_MouseDownEvent; + this.ButtonDownClickEvent -= Button_MouseDownEvent; return; } if (base.CanClick == false || this.IsSelected == true) @@ -54,16 +54,8 @@ //璁剧疆澶勪簬閫夋嫨鐘舵�佹椂,鏄剧ず鐨勫浘鏍� this.SetSelectPictrue(); - new System.Threading.Thread(() => - { - System.Threading.Thread.Sleep(ControlCommonResourse.StatuChangedWaitTime); - Application.RunOnMainThread(() => - { - //璁剧疆澶勪簬闈為�夋嫨鐘舵�佹椂,鏄剧ず鐨勫浘鏍� - this.SetUnSelectPictrue(); - }); - }) - { IsBackground = true }.Start(); + //璁剧疆澶勪簬闈為�夋嫨鐘舵�佹椂,鏄剧ず鐨勫浘鏍� + this.SetUnSelectPictrue(true); } /// <summary> @@ -77,10 +69,29 @@ /// <summary> /// 璁剧疆澶勪簬闈為�夋嫨鐘舵�佹椂,鏄剧ず鐨勫浘鏍� /// </summary> - public void SetUnSelectPictrue() + /// <param name="waitTime">杩藉姞鍙橀噺:鏄惁绛夊緟</param> + public void SetUnSelectPictrue(bool waitTime) { - //璁剧疆涓嶉�夋嫨鐘舵�� - this.IsSelected = false; + if (waitTime == false) + { + Application.RunOnMainThread(() => + { + //璁剧疆涓嶉�夋嫨鐘舵�� + this.IsSelected = false; + }); + } + else + { + HdlThreadLogic.Current.RunThread(() => + { + System.Threading.Thread.Sleep(ControlCommonResourse.StatuChangedWaitTime); + Application.RunOnMainThread(() => + { + //璁剧疆涓嶉�夋嫨鐘舵�� + this.IsSelected = false; + }); + }); + } } #endregion } -- Gitblit v1.8.0