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