From d6fb0646531172f23648441c224cdcccd721b894 Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期一, 14 十二月 2020 09:59:01 +0800 Subject: [PATCH] 请合并代码,完成晾衣架最终功能。 --- ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionMenuControl.cs | 97 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 97 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionMenuControl.cs b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionMenuControl.cs new file mode 100755 index 0000000..5a8af2c --- /dev/null +++ b/ZigbeeApp/Shared/Phone/MainPage/Controls/DeviceFunctionMenuControl.cs @@ -0,0 +1,97 @@ +锘縰sing Shared.Phone.UserCenter; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Shared.Phone.MainPage.Controls +{ + /// <summary> + /// 璁惧鍔熻兘鑿滃崟鐨勫浘鏍囨帶浠� + /// </summary> + public class DeviceFunctionMenuControl : FrameLayoutStatuControl + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 鑳屾櫙鎺т欢 + /// </summary> + private PicViewControl btnBackGroud = null; + /// <summary> + /// 璁惧鍥炬爣鎺т欢 + /// </summary> + private IconViewControl btnDeviceIcon = null; + /// <summary> + /// 鏂囨湰鎺т欢 + /// </summary> + private NormalViewControl btnDeviceName = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鏈垎閰嶇晫闈㈢殑璁惧鍔熻兘鍥炬爣鎺т欢 + /// </summary> + public DeviceFunctionMenuControl() + { + this.Width = Application.GetRealWidth(220); + this.Height = Application.GetRealHeight(279); + this.UseClickStatu = false; + } + + /// <summary> + /// 鍒濆鍖� + /// </summary> + /// <param name="text">鏄剧ず鐨勬枃鏈�</param> + /// <param name="unSelectPath">鍥剧墖1</param> + /// <param name="selectPath">鍥剧墖2</param> + public void InitControl(string text, string unSelectPath, string selectPath) + { + //鑳屾櫙鎺т欢 + this.btnBackGroud = new PicViewControl(150, 173); + btnBackGroud.Y = Application.GetRealHeight(35); + btnBackGroud.Gravity = Gravity.CenterHorizontal; + btnBackGroud.UnSelectedImagePath = "Item/Category_FunctionBG.png"; + btnBackGroud.SelectedImagePath = "Item/Category_FunctionBGSelected.png"; + this.AddChidren(btnBackGroud, ChidrenBindMode.BindEvent); + + //璁惧鍥炬爣 + this.btnDeviceIcon = new IconViewControl(84); + btnDeviceIcon.Y = Application.GetRealHeight(63); + btnDeviceIcon.UnSelectedImagePath = unSelectPath; + btnDeviceIcon.SelectedImagePath = selectPath; + btnDeviceIcon.Gravity = Gravity.CenterHorizontal; + this.AddChidren(btnDeviceIcon, ChidrenBindMode.BindEvent); + + //鏂囨湰 + this.btnDeviceName = new NormalViewControl(170, 60, true); + btnDeviceName.Y = Application.GetRealHeight(200); + btnDeviceName.Gravity = Gravity.CenterHorizontal; + btnDeviceName.TextColor = Common.ZigbeeColor.Current.GXCTextBlackColor; + btnDeviceName.SelectedTextColor = Common.ZigbeeColor.Current.GXCTextSelectedColor; + btnDeviceName.TextSize = 11; + btnDeviceName.Text = text; + btnDeviceName.TextAlignment = TextAlignment.Center; + this.AddChidren(btnDeviceName, ChidrenBindMode.BindEvent); + } + + #endregion + + #region 鈻� 璁剧疆鐘舵�乢__________________________ + + /// <summary> + /// 璁剧疆閫夋嫨鐘舵�� + /// </summary> + /// <param name="isSelect"></param> + public void SetSelectStatu(bool isSelect) + { + this.btnBackGroud.IsSelected = isSelect; + this.btnDeviceIcon.IsSelected = isSelect; + this.btnDeviceName.IsSelected = isSelect; + this.btnDeviceName.IsBold = isSelect; + } + + #endregion + + } +} -- Gitblit v1.8.0