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/CompoundControls/NormalSelectControl.cs | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 154 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/NormalSelectControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/NormalSelectControl.cs new file mode 100644 index 0000000..7c81bf9 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/NormalSelectControl.cs @@ -0,0 +1,154 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace Shared.Phone.UserCenter +{ + /// <summary> + /// 鍋氭垚涓�涓畝鍗曠殑閫夋嫨鎺т欢 + /// </summary> + public class NormalSelectControl : FrameRowControl + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鏄剧ず鏂囨湰 + /// </summary> + private string textValue = string.Empty; + /// <summary> + /// 涓嬮儴鏄剧ず鏂囨湰 + /// </summary> + private string textBottomValue = null; + /// <summary> + /// 鏂囨湰鎺т欢 + /// </summary> + private NormalViewControl btnText = null; + /// <summary> + /// 閫夋嫨鎺т欢 + /// </summary> + private MostRightIconControl btnSelect = null; + /// <summary> + /// 鐘舵�� + /// </summary> + private StatuMode Statu = StatuMode.UN_SELECT; + /// <summary> + /// 鏄惁澶勪簬閫夋嫨鐘舵�� + /// </summary> + public bool IsSelected + { + get { return Statu == StatuMode.SELECT; } + set + { + if (value == false) + { + this.SetUnselectStatu(); + } + else + { + this.SetSelectStatu(); + } + } + } + /// <summary> + /// 澶勪簬閫変腑鎴栬�呴潪閫変腑鐘舵�佹椂锛屾槸鍚﹀彉鏇村瓧浣撻鑹� + /// </summary> + public bool ChangedTextColor = true; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鍋氭垚涓�涓畝鍗曠殑閫夋嫨鎺т欢 + /// </summary> + /// <param name="i_text">鏄剧ず鏂囨湰</param> + /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(銆愬垪琛ㄦ帶浠剁殑rowSpace/2銆戝嵆鍙�,涓嶆噦榛樿涓�0鍗冲彲)</param> + public NormalSelectControl(string i_text, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis) + { + this.textValue = i_text; + } + + /// <summary> + /// 鍋氭垚涓�涓畝鍗曠殑閫夋嫨鎺т欢 + /// </summary> + /// <param name="i_topText">涓婇儴鏄剧ず鏂囨湰</param> + /// <param name="i_bottomText">涓嬮儴鏄剧ず鏂囨湰</param> + /// <param name="i_ChidrenYaxis">瀛愭帶浠禮杞村亸绉婚噺(銆愬垪琛ㄦ帶浠剁殑rowSpace/2銆戝嵆鍙�,涓嶆噦榛樿涓�0鍗冲彲)</param> + public NormalSelectControl(string i_topText, string i_bottomText, int i_ChidrenYaxis = 0) : base(i_ChidrenYaxis) + { + this.textValue = i_topText; + this.textBottomValue = i_bottomText; + } + + /// <summary> + /// 鍒濆鍖栧唴閮ㄦ帶浠� + /// </summary> + /// <param name="iconParh">宸︿晶鍥炬爣</param> + public void InitControl(string iconParh = "") + { + //鍥剧墖 + if (iconParh != "") + { + var btnIcon = this.AddLeftIcon(); + btnIcon.UnSelectedImagePath = iconParh; + } + if (this.textBottomValue == null) + { + //鏄剧ず鏂囨湰 + btnText = this.AddLeftCaption(this.textValue, 600); + btnText.TextColor = UserCenterColor.Current.TextGrayColor3; + } + else + { + //鏄剧ず鏂囨湰 + btnText = this.AddTopView(this.textValue, 600); + this.AddBottomView(this.textBottomValue, 600); + } + //閫夋嫨鎺т欢 + btnSelect = this.AddMostRightEmptyIcon(58, 58); + btnSelect.Visible = false; + btnSelect.UnSelectedImagePath = "Item/ItemSelected.png"; + } + + #endregion + + #region 鈻� 閫夋嫨鐘舵�乢__________________________ + + /// <summary> + /// 璁惧畾閫夋嫨鐘舵�� + /// </summary> + private void SetSelectStatu() + { + if (Statu == StatuMode.SELECT) + { + return; + } + btnSelect.Visible = true; + if (this.ChangedTextColor == true) + { + btnText.TextColor = UserCenterColor.Current.TextColor1; + } + //鐘舵�佸彉鏇� + Statu = StatuMode.SELECT; + } + + /// <summary> + /// 璁剧疆闈為�夋嫨鐘舵�� + /// </summary> + private void SetUnselectStatu() + { + if (Statu == StatuMode.UN_SELECT) + { + return; + } + btnSelect.Visible = false; + if (this.ChangedTextColor == true) + { + btnText.TextColor = UserCenterColor.Current.TextGrayColor3; + } + //鐘舵�佸彉鏇� + Statu = StatuMode.UN_SELECT; + } + #endregion + } +} -- Gitblit v1.8.0