using System;
|
|
namespace Shared.SimpleControl.Pad
|
{
|
/// <summary>
|
/// 用户界面标题栏
|
/// </summary>
|
public static class UserTop
|
{
|
/// <summary>
|
/// 标题栏
|
/// </summary>
|
public static readonly FrameLayout FrameLayoutMain = new FrameLayout () {
|
Y = Application.GetRealHeight (20),
|
Height = Application.GetRealHeight (130)
|
};
|
|
/// <summary>
|
/// 初始化用户界面的标题栏
|
/// </summary>
|
public static void Init ()
|
{
|
if (null != FrameLayoutMain.Parent) {
|
return;
|
}
|
UserHomePage.FrameLayoutMain.AddChidren (FrameLayoutMain);
|
initTopFrameLaout ();
|
}
|
|
static void initTopFrameLaout ()
|
{
|
Button LogoButton = new Button () {
|
Width = Application.GetRealWidth (154),
|
Height = Application.GetRealHeight (90),
|
UnSelectedImagePath = MainPage.LogoString,
|
};
|
FrameLayoutMain.AddChidren (LogoButton);
|
LogoButton.MouseLongEventHandler+=(sender, e) => {
|
//new Alert ("No.", UserConfig.Current.tokenID, "Close").Show ();
|
//UserConfig.Current.HideDeviceTypes = new System.Collections.Generic.List<int> ();
|
//UserConfig.Current.SaveUserConfig ();
|
};
|
|
Button NameButton = new Button () {
|
Width = Application.GetRealWidth (400),
|
Height = Application.GetMinReal (60),
|
Text = MainPage.SoftPadTitle,
|
TextColor = SkinStyle.Current.TextColor1,
|
Gravity = Gravity.Center,
|
TextAlignment = TextAlignment.Center,
|
TextSize = 20,
|
};
|
FrameLayoutMain.AddChidren (NameButton);
|
|
Button ItemButton = new Button () {
|
Width = Application.GetRealWidth (105),
|
Height = Application.GetRealHeight (80),
|
UnSelectedImagePath = "Item/Item.png",
|
SelectedImagePath = "Item/Item.png",
|
Y = Application.GetRealHeight (40),
|
};
|
ItemButton.X = FrameLayoutMain.Width - ItemButton.Width - Application.GetRealWidth(50);
|
ItemButton.MouseUpEventHandler += (sender, e) => {
|
//右边的菜单栏是否显示
|
new UserListItem ().Show ();
|
};
|
FrameLayoutMain.AddChidren (ItemButton);
|
}
|
}
|
}
|