using System;
|
namespace Shared.SimpleControl.Phone
|
{
|
public class UserSensorSettingPage : FrameLayout
|
{
|
public void ShowUserSensorSettingPage (System.Collections.Generic.List<Common> sensorList)
|
{
|
#region 标题
|
var topView = new FrameLayout () {
|
Y = Application.GetRealHeight (36),
|
Height = Application.GetRealHeight (90),
|
BackgroundColor = SkinStyle.Current.MainColor
|
};
|
AddChidren (topView);
|
|
var title = new Button () {
|
TextAlignment = TextAlignment.Center,
|
TextID = R.MyInternationalizationString.Setting,
|
TextColor = SkinStyle.Current.TextColor1,
|
TextSize = 19,
|
};
|
topView.AddChidren (title);
|
|
var logo = new Button () {
|
Width = Application.GetRealWidth (154),
|
Height = Application.GetRealHeight (90),
|
X = Application.GetRealWidth (486),
|
UnSelectedImagePath = MainPage.LogoString,
|
};
|
topView.AddChidren (logo);
|
var back = new Button () {
|
Height = Application.GetRealHeight (90),
|
Width = Application.GetRealWidth (85),
|
UnSelectedImagePath = "Item/Back.png",
|
SelectedImagePath = "Item/BackSelected.png",
|
};
|
topView.AddChidren (back);
|
back.MouseUpEventHandler += (sender, e) => {
|
(Parent as PageLayout).PageIndex -= 1;
|
};
|
#endregion
|
|
var pushView = new RowLayout () {
|
Y = topView.Bottom,
|
Height = Application.GetRealHeight(100),
|
};
|
AddChidren (pushView);
|
var pushTitle = new Button () {
|
X = Application.GetRealWidth(60),
|
Width = Application.GetRealWidth(300),
|
TextID = R.MyInternationalizationString.SetPush,
|
TextColor = SkinStyle.Current.TextColor1,
|
TextAlignment = TextAlignment.CenterLeft,
|
};
|
pushView.AddChidren (pushTitle);
|
|
var rightButton = new Button () {
|
Width = Application.GetRealWidth (28),
|
Height = Application.GetRealHeight (40),
|
Gravity = Gravity.CenterVertical,
|
X = Application.GetRealWidth (580),
|
UnSelectedImagePath = "Item/Right.png",
|
SelectedImagePath = "Item/RightSelected.png",
|
};
|
pushView.AddChidren (rightButton);
|
|
EventHandler<MouseEventArgs> clickEventHandler = (sender, e) => {
|
var usp = new UserSensorSettingPushPage ();
|
UserMiddle.DevicePageView.AddChidren (usp);
|
usp.ShowUserSensorSettingPushPage (sensorList);
|
UserMiddle.DevicePageView.PageIndex = 4;
|
};
|
pushView.MouseUpEventHandler += clickEventHandler;
|
rightButton.MouseUpEventHandler += clickEventHandler;
|
pushTitle.MouseUpEventHandler += clickEventHandler;
|
|
var AutomaticView = new RowLayout () {
|
Y = pushView.Bottom,
|
Height = Application.GetRealHeight (100),
|
};
|
AddChidren (AutomaticView);
|
var automaticTitle = new Button () {
|
X = Application.GetRealWidth (60),
|
Width = Application.GetRealWidth (300),
|
TextID = R.MyInternationalizationString.AutomationSetting,
|
TextColor = SkinStyle.Current.TextColor1,
|
TextAlignment = TextAlignment.CenterLeft,
|
};
|
AutomaticView.AddChidren (automaticTitle);
|
|
var btnRightAutomatic = new Button () {
|
Width = Application.GetRealWidth (28),
|
Height = Application.GetRealHeight (40),
|
Gravity = Gravity.CenterVertical,
|
X = Application.GetRealWidth (580),
|
UnSelectedImagePath = "Item/Right.png",
|
SelectedImagePath = "Item/RightSelected.png",
|
};
|
AutomaticView.AddChidren (btnRightAutomatic);
|
|
EventHandler<MouseEventArgs> clickAutomaticEventHandler = (sender, e) => {
|
var usp = new UserSensorAutomationPage (sensorList);
|
UserMiddle.DevicePageView.AddChidren (usp);
|
usp.ShowPage ();
|
UserMiddle.DevicePageView.PageIndex = 4;
|
};
|
btnRightAutomatic.MouseUpEventHandler += clickAutomaticEventHandler;
|
automaticTitle.MouseUpEventHandler += clickAutomaticEventHandler;
|
AutomaticView.MouseUpEventHandler += clickAutomaticEventHandler;
|
}
|
}
|
}
|