using Shared.SimpleControl.Phone;
|
using System;
|
/*
|
移除后台远程连接,讲远程连接移动到用户节目侧边栏 2017-02-10
|
*/
|
namespace Shared.SimpleControl.Pad
|
{
|
/// <summary>
|
/// 显示功能的导航栏
|
/// </summary>
|
public static class SystemMiddleTop
|
{
|
/// <summary>
|
/// 当前主视图
|
/// </summary>
|
public static readonly FrameLayout SystemTopMeunView = new FrameLayout () {
|
Height = Application.GetRealHeight (130),
|
};
|
|
static readonly Button TopBottomLine = new Button () {
|
Y = Application.GetRealHeight(122),
|
Width = Application.GetRealWidth (685),
|
Height = Application.GetRealHeight(8),
|
BackgroundColor = SkinStyle.Current.SelectedColor,
|
};
|
|
/// <summary>
|
/// 网关功能
|
/// </summary>
|
public static readonly Button gateWay = new Button {
|
Width = Application.GetRealWidth (680),
|
Height = LayoutParams.MatchParent,
|
SelectedBackgroundColor = 0xFF333333,
|
BackgroundColor = 0xFF2f2f2f,
|
TextSize = 18,
|
TextID = R.MyInternationalizationString.GateWay,
|
TextAlignment = TextAlignment.Center,
|
IsSelected = true,
|
};
|
/// <summary>
|
/// 设备功能
|
/// </summary>
|
static readonly Button equipmentButton = new Button {
|
Width = Application.GetRealWidth (680),
|
Height = LayoutParams.MatchParent,
|
SelectedBackgroundColor = 0xFF333333,
|
BackgroundColor = 0xFF2f2f2f,
|
TextID = R.MyInternationalizationString.Equipment,
|
TextSize = 18,
|
TextAlignment = TextAlignment.Center,
|
};
|
/// <summary>
|
/// 房间功能
|
/// </summary>
|
static readonly Button roomButton = new Button {
|
Width = Application.GetRealWidth (680),
|
Height = LayoutParams.MatchParent,
|
SelectedBackgroundColor = 0xFF333333,
|
BackgroundColor = 0xFF2f2f2f,
|
TextSize = 18,
|
TextID = R.MyInternationalizationString.Room,
|
TextAlignment = TextAlignment.Center,
|
};
|
/// <summary>
|
/// 初始当前视图
|
/// </summary>
|
public static void Init ()
|
{
|
if (null != SystemTopMeunView.Parent) {
|
return;
|
}
|
SystemTopMeunView.Y = SystemTop.FrameLayoutMain.Bottom;
|
SystemHomePage.FrameLayoutMain.AddChidren (SystemTopMeunView);
|
initTopFrameLaout ();
|
}
|
/// <summary>
|
/// 当前选择的按键标记为选中状态
|
/// </summary>
|
/// <param name="button">Button.</param>
|
public static void selected (Button button)
|
{
|
gateWay.IsSelected = false;
|
equipmentButton.IsSelected = false;
|
roomButton.IsSelected = false;
|
button.IsSelected = true;
|
TopBottomLine.X = button.X - Application.GetRealWidth(5);
|
}
|
|
/// <summary>
|
/// 初始化上面的控件
|
/// </summary>
|
static void initTopFrameLaout ()
|
{
|
gateWay.MouseUpEventHandler += (sender, e) => {
|
selected (gateWay);
|
SystemMiddle.ShowGateWayFrameLayout ();
|
};
|
gateWay.X = 0;
|
SystemTopMeunView.AddChidren (gateWay);
|
Button btnNull = new Button () {
|
X = gateWay.Right,
|
Width = Application.GetRealWidth(5),
|
BackgroundColor = 0xFF333333,
|
};
|
SystemTopMeunView.AddChidren (btnNull);
|
|
equipmentButton.MouseUpEventHandler += (sender, e) => {
|
selected (equipmentButton);
|
CommonPage.FindGatewayChilrenIPAddress = "255.255.255.255";
|
SystemMiddle.ShowEquipmentBase ();
|
};
|
equipmentButton.X = btnNull.Right;
|
SystemTopMeunView.AddChidren (equipmentButton);
|
Button btnNull2 = new Button () {
|
X = equipmentButton.Right,
|
Width = Application.GetRealWidth(5),
|
BackgroundColor = 0xFF333333,
|
};
|
SystemTopMeunView.AddChidren (btnNull2);
|
|
roomButton.MouseUpEventHandler += (sender, e) => {
|
selected (roomButton);
|
new SystemRoom().ShowRoomList ();
|
};
|
roomButton.X = btnNull2.Right;
|
SystemTopMeunView.AddChidren (roomButton);
|
SystemTopMeunView.AddChidren (TopBottomLine);
|
}
|
}
|
}
|