From dc0309e64f02227d8e1468b7326c07955f804612 Mon Sep 17 00:00:00 2001 From: chenqiyang <1406175257@qq.com> Date: 星期三, 22 六月 2022 11:22:18 +0800 Subject: [PATCH] 修改引用路径 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Common/IconControlCommon.cs | 98 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 98 insertions(+), 0 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 new file mode 100644 index 0000000..b9703db --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Common/IconControlCommon.cs @@ -0,0 +1,98 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace Shared.Phone.UserCenter +{ + /// <summary> + /// Icon鎺т欢鐨勫叡閫� + /// </summary> + public class IconControlCommon : ButtonBase + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鏄惁鍚敤鐐逛寒鍔熻兘(榛樿涓嶅惎鐢�) + /// </summary> + public bool UseClickStatu = false; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// Icon鎺т欢鐨勫叡閫� + /// </summary> + public IconControlCommon() + { + //杩欎釜浜嬩欢鏄悶鐐逛寒鐗规晥鐨� + this.ButtonDownClickEvent += this.Button_MouseDownEvent; + } + + #endregion + + #region 鈻� 鎺т欢鐐逛寒鐗规晥_______________________ + + /// <summary> + /// 鍗曞嚮鎸変笅浜嬩欢 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void Button_MouseDownEvent(object sender, MouseEventArgs e) + { + if (this.UseClickStatu == false || string.IsNullOrEmpty(this.SelectedImagePath) == true) + { + //姘镐箙绉婚櫎 + this.ButtonDownClickEvent -= Button_MouseDownEvent; + return; + } + if (base.CanClick == false || this.IsSelected == true) + { + //鎺т欢涓嶈兘鐐瑰嚮,鎴栬�呭綋鍓嶅浜庨�夋嫨鐘舵��,鍒欎笉鑳借Е鍙� + return; + } + //璁剧疆澶勪簬閫夋嫨鐘舵�佹椂,鏄剧ず鐨勫浘鏍� + this.SetSelectPictrue(); + + //璁剧疆澶勪簬闈為�夋嫨鐘舵�佹椂,鏄剧ず鐨勫浘鏍� + this.SetUnSelectPictrue(true); + } + + /// <summary> + /// 璁剧疆澶勪簬閫夋嫨鐘舵�佹椂,鏄剧ず鐨勫浘鏍� + /// </summary> + public void SetSelectPictrue() + { + this.IsSelected = true; + } + + /// <summary> + /// 璁剧疆澶勪簬闈為�夋嫨鐘舵�佹椂,鏄剧ず鐨勫浘鏍� + /// </summary> + /// <param name="waitTime">杩藉姞鍙橀噺:鏄惁绛夊緟</param> + public void SetUnSelectPictrue(bool waitTime) + { + if (waitTime == false) + { + HdlThreadLogic.Current.RunMain(() => + { + //璁剧疆涓嶉�夋嫨鐘舵�� + this.IsSelected = false; + }); + } + else + { + HdlThreadLogic.Current.RunThread(() => + { + System.Threading.Thread.Sleep(ControlCommonResourse.StatuChangedWaitTime); + HdlThreadLogic.Current.RunMain(() => + { + //璁剧疆涓嶉�夋嫨鐘舵�� + this.IsSelected = false; + }); + }); + } + } + #endregion + } +} -- Gitblit v1.8.0