using System; using System.Collections.Generic; using System.Text; namespace Shared.Phone.UserCenter { /// /// 做成一个信息的RowLayout(左边有个图标) /// public class OnlyCenterViewRow : StatuRowLayout { /// /// 图标控件 /// public RowLeftIconView btnIcon = null; /// /// 显示文本控件 /// public RowCenterView btnName = null; /// /// 做成一个信息的RowLayout(左边有个图标) /// /// 列表控件 /// 显示文本 /// 非选择的图标 /// 选择的图标 public OnlyCenterViewRow(VerticalScrolViewLayout listView, string i_txtValue, string i_unSelectPath = null, string i_selectPath = null) { listView.AddChidren(this); //初始化内部控件之前 this.InitControlBefore(i_unSelectPath, i_selectPath, i_txtValue); //初始化内部控件 this.InitControl(); } /// /// 做成一个信息的RowLayout(左边有个图标),添加此控件到容器后,调用【InitControl()】完成初始化 /// /// 显示文本 /// 非选择的图标 /// 选择的图标 public OnlyCenterViewRow(string i_txtValue, string i_unSelectPath = null, string i_selectPath = null) { //初始化内部控件之前 this.InitControlBefore(i_unSelectPath, i_selectPath, i_txtValue); } /// /// 初始化内部控件 /// public void InitControl() { //图标 this.AddChidren(this.btnIcon); //显示文本 this.AddChidren(this.btnName); } /// /// 将图标控件适配为【点号】控件 /// public void ChangedIconInPointMode() { //将控件适配为【点号】控件 this.btnIcon.ChangedControlInPointMode(); } /// /// 初始化内部控件之前 /// /// /// /// private void InitControlBefore(string i_unSelectPath, string i_selectPath, string i_txtValue) { this.btnIcon = new RowLeftIconView(); this.btnIcon.UnSelectedImagePath = i_unSelectPath; this.btnIcon.SelectedImagePath = i_selectPath; this.btnName = new RowCenterView(); this.btnName.Text = i_txtValue; } } }