xm
2019-07-16 b910cb79c9b5bcc204022a3cf9e6950f0a64dfbd
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
122
123
124
125
126
127
128
129
130
131
132
using System;
using Shared.Common;
namespace Shared.Phone.Device.Account
{
    public class RegistrationPhoneOREmail:FrameLayout
    {
        public RegistrationPhoneOREmail()
        {
            BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
            Tag = "Register";
        }
        public void Show()
        {
            #region midFrameLayout
            var midFrameLayout = new FrameLayout()
            {
                Width = LayoutParams.MatchParent,
                Height = Application.GetRealHeight(1920),
                BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
            };
            AddChidren(midFrameLayout);
            #endregion
 
            #region 布局logo 手机注册  邮箱注册 已有账号?登录
 
            var logoBtn = new Button()
            {
                Width = Application.GetMinRealAverage(270),
                Height = Application.GetMinRealAverage(270),
                Y = Application.GetRealHeight(330),
                UnSelectedImagePath = "Logo/Logo.png",
                Gravity = Gravity.CenterHorizontal
            };
            midFrameLayout.AddChidren(logoBtn);
 
            var registerByPhoneFL = new FrameLayout()
            {
                Width = Application.GetRealWidth(700),
                Height = Application.GetRealHeight(110),
                Y = Application.GetRealHeight(200) + logoBtn.Bottom,
                Radius = (uint)Application.GetRealHeight(55),
                BackgroundColor = ZigbeeColor.Current.GXCButtonBlueColor,
                Gravity = Gravity.CenterHorizontal
            };
            midFrameLayout.AddChidren(registerByPhoneFL);
            var registerByPhoneImg = new Button()
            {
                X = Application.GetRealWidth(150 - 70),
                Width = Application.GetMinRealAverage(70),
                Height = Application.GetMinRealAverage(70),
                UnSelectedImagePath = "Account/Phone.png",
                Gravity = Gravity.CenterVertical
            };
            registerByPhoneFL.AddChidren(registerByPhoneImg);
            var registerByPhoneBtn = new Button()
            {
                Width = Application.GetRealWidth(350),
                Gravity=Gravity.CenterHorizontal,
                TextAlignment = TextAlignment.Center,
                TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
                TextID = R.MyInternationalizationString.RegisterByPhone,
            };
            registerByPhoneFL.AddChidren(registerByPhoneBtn);
 
            var registerByEmailFL = new FrameLayout()
            {
                Width = Application.GetRealWidth(700),
                Height = Application.GetRealHeight(110),
                Y = registerByPhoneFL.Bottom + Application.GetRealHeight(100),
                Radius = (uint)Application.GetRealHeight(55),
                BackgroundColor = ZigbeeColor.Current.GXCButtonBlueColor,
                Gravity = Gravity.CenterHorizontal
            };
            midFrameLayout.AddChidren(registerByEmailFL);
            var registerByEmailPic = new Button()
            {
                X=Application.GetRealWidth(150-70),
                Width = Application.GetMinRealAverage(70),
                Height = Application.GetMinRealAverage(70),
                UnSelectedImagePath = "Account/Email.png",
                Gravity=Gravity.CenterVertical
            };
            registerByEmailFL.AddChidren(registerByEmailPic);
            var registerByEmailBtn = new Button()
            {
                Width = Application.GetRealWidth(350),
                TextAlignment = TextAlignment.Center,
                TextColor = ZigbeeColor.Current.GXCTextWhiteColor,
                TextID = R.MyInternationalizationString.RegisterByEmail,
                Gravity = Gravity.CenterHorizontal
            };
            registerByEmailFL.AddChidren(registerByEmailBtn);
            
            var loginBtn = new Button()
            {
                Width = Application.GetRealWidth(500),
                Height = Application.GetRealHeight(80),
                Y = midFrameLayout.Bottom-Application.GetRealHeight(200) ,
                TextID = R.MyInternationalizationString.LoginHadAccountPWD,
                TextSize = 15,
                TextColor = ZigbeeColor.Current.GXCTextBlueColor,
                Gravity = Gravity.CenterHorizontal
            };
            midFrameLayout.AddChidren(loginBtn);
 
            registerByPhoneBtn.MouseUpEventHandler += (sender, e) =>
            {
                var registerPhone = new Account.RegistrationByPhone();
                this.AddChidren(registerPhone);
                registerPhone.Show();
            };
            EventHandler<MouseEventArgs> RegisiterByEmailHandler = (sender, e) =>
            {
                var registerEmail = new Account.RegistrationByEmail();
                this.AddChidren(registerEmail);
                registerEmail.Show();
            };
            registerByEmailBtn.MouseUpEventHandler += RegisiterByEmailHandler;
            registerByEmailPic.MouseUpEventHandler += RegisiterByEmailHandler;
 
            loginBtn.MouseDownEventHandler += (sender, e) =>
            {
                this.RemoveFromParent();
                var login = new AccountLogin();
                Shared.Common.CommonPage.Instance.AddChidren(login);
                login.Show();
            };
            #endregion
        }
 
    }
}