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
|
}
|
|
}
|
}
|