wei
2020-12-15 7d9e5d946d08f0b53ff25d1c25dcf83efb68b734
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
using System;
using Shared;
using HDL_ON.UI.CSS;
 
namespace HDL_ON.UI
{
    public class BindingResidencePage : FrameLayout
    {
        public BindingResidencePage()
        {
        }
 
        public void LoadView()
        {
            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);
            };
        }
    }
}