using System;
using Shared.Common;
namespace Shared.Phone.Device.CommonForm
{
public class ButtonLineForm:FrameLayout
{
///
/// name
///
public Button NameBtn;
///
/// line
///
public Line Line;
///
/// isSelected
///
private bool v_Selected;
///
/// IsSelected
///
public bool IsSelected
{
set
{
try
{
v_Selected = value;
SetStatu(v_Selected);
}
catch
{
v_Selected = false;
SetStatu(v_Selected);
}
}
get
{
return v_Selected;
}
}
///
/// ButtonLineForm
///
///
///
///
///
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);
}
///
/// Init
///
public void Init()
{
NameBtn = new SelectedStatuButton()
{
Width = Width,
Height = Height - 3
};
AddChidren(NameBtn);
Line = new Line(Height,Width/2,2);
AddChidren(Line);
}
///
/// SetTitle
///
///
public void SetTitle(string title)
{
NameBtn.Text = title;
}
///
/// SetTitle
///
///
public void SetTitle(int title)
{
SetTitle(Language.StringByID(title));
}
///
/// SetStatu
///
///
public void SetStatu(bool statu)
{
NameBtn.IsSelected = Line.IsSelected = statu;
}
}
}