using Shared.Phone.UserCenter;
using System;
using System.Collections.Generic;
using System.Text;
namespace Shared.Phone.MainPage.Controls
{
///
/// 设备功能菜单的图标控件
///
public class DeviceFunctionMenuControl : FrameLayoutStatuControl
{
#region ■ 变量声明___________________________
///
/// 背景控件
///
private PicViewControl btnBackGroud = null;
///
/// 设备图标控件
///
private IconViewControl btnDeviceIcon = null;
///
/// 文本控件
///
private NormalViewControl btnDeviceName = null;
#endregion
#region ■ 初始化_____________________________
///
/// 未分配界面的设备功能图标控件
///
public DeviceFunctionMenuControl()
{
this.Width = Application.GetRealWidth(220);
this.Height = Application.GetRealHeight(279);
this.UseClickStatu = false;
}
///
/// 初始化
///
/// 显示的文本
/// 图片1
/// 图片2
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 ■ 设置状态___________________________
///
/// 设置选择状态
///
///
public void SetSelectStatu(bool isSelect)
{
this.btnBackGroud.IsSelected = isSelect;
this.btnDeviceIcon.IsSelected = isSelect;
this.btnDeviceName.IsSelected = isSelect;
this.btnDeviceName.IsBold = isSelect;
}
#endregion
}
}