using System;
|
using Shared;
|
using HDL_ON.UI.CSS;
|
|
namespace HDL_ON.UI
|
{
|
public class BindingResidencePage : FrameLayout
|
{
|
public BindingResidencePage()
|
{
|
}
|
|
public void LoadDialog()
|
{
|
BackgroundColor = CSS_Color.MainBackgroundColor;
|
|
FrameLayout bodyView = new FrameLayout();
|
AddChidren(bodyView);
|
|
Button btnIcon = new Button()
|
{
|
X = Application.GetRealWidth(108),
|
Y = Application.GetRealWidth(102),
|
Width = Application.GetRealWidth(160),
|
Height = Application.GetRealWidth(160),
|
UnSelectedImagePath = "oRobot.png",
|
};
|
bodyView.AddChidren(btnIcon);
|
|
Button btnWelcome = new Button()
|
{
|
Y = btnIcon.Bottom,
|
Height = Application.GetRealHeight(120),
|
TextAlignment = TextAlignment.Center,
|
TextColor = CSS_Color.MainColor,
|
TextSize = CSS_FontSize.SubheadingFontSize,
|
TextID = StringId.WelcomeToOnPlus,
|
};
|
bodyView.AddChidren(btnWelcome);
|
|
|
Button btnAddNewResidence = new Button()
|
{
|
Gravity = Gravity.CenterHorizontal,
|
Y = Application.GetRealHeight(379),
|
Width = Application.GetRealWidth(220),
|
Height = Application.GetRealWidth(44),
|
Radius = (uint)Application.GetRealWidth(22),
|
BackgroundColor = CSS_Color.MainColor,
|
TextColor = CSS_Color.MainBackgroundColor,
|
TextSize = CSS_FontSize.SubheadingFontSize,
|
TextAlignment = TextAlignment.Center,
|
TextID = StringId.AddNewResidence,
|
IsBold = true,
|
};
|
bodyView.AddChidren(btnAddNewResidence);
|
|
Button btnTobeFamily = new Button()
|
{
|
Gravity = Gravity.CenterHorizontal,
|
Y = Application.GetRealHeight(439),
|
Width = Application.GetRealWidth(220),
|
Height = Application.GetRealWidth(44),
|
Radius = (uint)Application.GetRealWidth(22),
|
BorderColor = CSS_Color.MainColor,
|
BorderWidth = (uint)Application.GetRealWidth(1),
|
BackgroundColor = CSS_Color.MainBackgroundColor,
|
TextColor = CSS_Color.MainColor,
|
TextSize = CSS_FontSize.SubheadingFontSize,
|
TextAlignment = TextAlignment.Center,
|
TextID = StringId.TobeFamily,
|
IsBold = true,
|
};
|
bodyView.AddChidren(btnTobeFamily);
|
|
Button btnLogout = new Button()
|
{
|
Gravity = Gravity.CenterHorizontal,
|
Y = btnTobeFamily.Bottom + Application.GetRealWidth(10),
|
Width = Application.GetRealWidth(220),
|
Height = Application.GetRealWidth(44),
|
TextAlignment = TextAlignment.Center,
|
TextID = StringId.Logout,
|
TextSize = CSS_FontSize.SubheadingFontSize,
|
TextColor = CSS_Color.TextualColor,
|
IsBold = true,
|
};
|
bodyView.AddChidren(btnLogout);
|
|
|
|
btnAddNewResidence.MouseUpEventHandler = (sender, e) =>
|
{
|
Action<string> action = (str) => {
|
Application.RunOnMainThread(() => {
|
var pm = new DAL.Server.HttpServerRequest();
|
pm.BindingResidence(str);
|
});
|
};
|
Scan.OpenScan((scanString) =>
|
{
|
action(scanString);
|
});
|
};
|
|
btnTobeFamily.MouseUpEventHandler = (sender, e) =>
|
{
|
//我的二维码
|
var page = new MyQRCodePage();
|
AddChidren(page);
|
page.LoadPage();
|
//MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
|
};
|
|
btnLogout.MouseUpEventHandler = (sender, e) =>
|
{
|
MainPage.GoLoginPage(UserInfo.Current);
|
};
|
}
|
}
|
}
|