namespace Shared.SimpleControl.Phone
{
/// <summary>
/// 后面界面主页面
/// </summary>
public class SystemHomePage : FrameLayout
{
SystemMiddle systemMiddle;
SysMiddle sysMiddle;
PageLayout sysMiddlePageView = new PageLayout () {
Height = Application.GetRealHeight (936),
Y = Application.GetRealHeight (206),
BackgroundColor = SkinStyle.Current.ViewColor,
IsShowPoint = false
};
public static PageLayout sysMiddleGatewayPageView = new PageLayout () {
IsShowPoint = false
};
public static PageLayout sysMiddleDevicePageView = new PageLayout () {
IsShowPoint = false
};
public SystemHomePage ()
{
sysMiddlePageView.BackgroundColor = SkinStyle.Current.ViewColor;
AddChidren (sysMiddlePageView);
sysMiddleGatewayPageView.PageChange += (sender, e) => {
|
sysMiddlePageView.PageIndex = 0;
}
void InitTop ()
{
FrameLayout SystemTopView = new FrameLayout () {
Height = Application.GetRealHeight (126),
} ;
AddChidren (SystemTopView);
Button LogoButton = new Button () {
Y = Application.GetRealHeight (35),
Height = Application.GetRealHeight (90),
Width = Application.GetRealWidth (85),
UnSelectedImagePath = "Item/Back.png",
SelectedImagePath = "Item/BackSelected.png",
} ;
SystemTopView.AddChidren (LogoButton);
LogoButton.MouseUpEventHandler += (sender, e) => {
sysMiddleGatewayPageView.RemoveAll ();
sysMiddleDevicePageView.RemoveAll ();
sysMiddlePageView.RemoveAll ();
(Parent as PageLayout).PageIndex -= 1;
} ;
Button NameButton = new Button () {
Width = Application.GetRealWidth (400),
Height = Application.GetMinReal (90),
Text = UserConfig.Instance.CurrentRegion.RegionName,
TextColor = SkinStyle.Current.TextColor1,
Gravity = Gravity.CenterHorizontal,
TextAlignment = TextAlignment.Center,
Y = Application.GetRealHeight (30),
TextSize = 20,
} ;
SystemTopView.AddChidren (NameButton);
var logo = new Button () {
Width = Application.GetRealWidth (154),
Height = Application.GetRealHeight (90),
X = Application.GetRealWidth (486),
Y = Application.GetRealHeight (36),
UnSelectedImagePath = MainPage.LogoString,
};
SystemTopView.AddChidren (logo);
}
void InitMiddleTop ()
{
var HorizontalScrolViewMain = new HorizontalScrolViewLayout () {
Y = Application.GetRealHeight (126),
Height = Application.GetRealHeight (80),
ScrollEnabled = false
};
AddChidren (HorizontalScrolViewMain);
Button gateWay = new Button {
Width = Application.GetRealWidth (320),
Height = LayoutParams.MatchParent,
BackgroundColor = SkinStyle.Current.SysTitleView,
SelectedBackgroundColor = SkinStyle.Current.SelectedColor,
TextID = R.MyInternationalizationString.GateWay,
TextAlignment = TextAlignment.Center,
IsSelected = true,
SelectedTextColor = SkinStyle.Current.TextColor1,
TextColor = SkinStyle.Current.TextColor1,
};
HorizontalScrolViewMain.AddChidren (gateWay);
Button equipmentButton = new Button {
Width = Application.GetRealWidth (322),
Height = LayoutParams.MatchParent,
BackgroundColor = SkinStyle.Current.SysTitleView,
SelectedBackgroundColor = SkinStyle.Current.SelectedColor,
TextID = R.MyInternationalizationString.Equipment,
TextAlignment = TextAlignment.Center,
SelectedTextColor = SkinStyle.Current.TextColor1,
TextColor = SkinStyle.Current.TextColor1,
};
HorizontalScrolViewMain.AddChidren (equipmentButton);
gateWay.MouseUpEventHandler += (sender, e) => {
sysMiddleGatewayPageView.PageIndex = 0;
sysMiddleDevicePageView.PageIndex = 0;
//while (sysMiddleGatewayPageView.ChildrenCount > 1) {//子pageview保留首页
// sysMiddleGatewayPageView.RemoveAt (sysMiddleGatewayPageView.ChildrenCount - 1);
//}
|