using System;
|
using Shared.Common;
|
|
namespace Shared.Phone.Device.CommonForm
|
{
|
public class ButtonLineForm:FrameLayout
|
{
|
/// <summary>
|
/// name
|
/// </summary>
|
public Button NameBtn;
|
/// <summary>
|
/// line
|
/// </summary>
|
public Line Line;
|
/// <summary>
|
/// isSelected
|
/// </summary>
|
private bool v_Selected;
|
/// <summary>
|
/// IsSelected
|
/// </summary>
|
public bool IsSelected
|
{
|
set
|
{
|
try
|
{
|
v_Selected = value;
|
SetStatu(v_Selected);
|
}
|
catch
|
{
|
v_Selected = false;
|
SetStatu(v_Selected);
|
}
|
}
|
get
|
{
|
return v_Selected;
|
}
|
}
|
|
/// <summary>
|
/// ButtonLineForm
|
/// </summary>
|
/// <param name="x"></param>
|
/// <param name="y"></param>
|
/// <param name="width"></param>
|
/// <param name="height"></param>
|
public ButtonLineForm(int x, int y, int width, int height)
|
{
|
X = Application.GetRealWidth(x);
|
Y = Application.GetRealHeight(y);
|
Width = Application.GetRealWidth(width);
|
Height = Application.GetRealHeight(height);
|
}
|
|
/// <summary>
|
/// Init
|
/// </summary>
|
public void Init()
|
{
|
NameBtn = new SelectedStatuButton()
|
{
|
Width = Width,
|
Height = Height - 3
|
};
|
AddChidren(NameBtn);
|
|
Line = new Line(Height,Width/2,2);
|
AddChidren(Line);
|
}
|
|
/// <summary>
|
/// SetTitle
|
/// </summary>
|
/// <param name="title"></param>
|
public void SetTitle(string title)
|
{
|
NameBtn.Text = title;
|
}
|
|
/// <summary>
|
/// SetTitle
|
/// </summary>
|
/// <param name="title"></param>
|
public void SetTitle(int title)
|
{
|
SetTitle(Language.StringByID(title));
|
}
|
|
/// <summary>
|
/// SetStatu
|
/// </summary>
|
/// <param name="statu"></param>
|
public void SetStatu(bool statu)
|
{
|
NameBtn.IsSelected = Line.IsSelected = statu;
|
}
|
}
|
}
|