using System;
using System.Collections.Generic;
using System.Text;
namespace Shared.Phone
{
///
/// 数字表盘密码输入的弹窗界面
///
public class NumberPswInputDialogForm : DialogCommonForm
{
#region ■ 变量声明___________________________
///
/// 输入结束事件
///
public Action FinishInputEvent = null;
///
/// 密码输入控件
///
private PswNumberInputControl pswControl = null;
#endregion
#region ■ 初始化_____________________________
///
/// 画面显示(底层会固定调用此方法,借以完成画面创建)
///
/// 标题提示
/// 密码长度
public void ShowForm(string i_PasswordText, int i_pswLenth)
{
//初始化中部信息
this.InitMiddleFrame(i_PasswordText, i_pswLenth);
}
///
/// 初始化中部信息
///
/// 标题提示
/// 密码长度
private void InitMiddleFrame(string i_PasswordText, int i_pswLenth)
{
var frameBack = new FrameLayout();
frameBack.Y = Application.GetRealHeight(160);
frameBack.Gravity = Gravity.CenterHorizontal;
frameBack.Width = Application.GetRealWidth(965);
frameBack.Height = Application.GetRealHeight(1584);
frameBack.BackgroundColor = UserCenterColor.Current.White;
frameBack.Radius = (uint)Application.GetRealHeight(17);
bodyFrameLayout.AddChidren(frameBack);
//密码输入控件
this.pswControl = new PswNumberInputControl(i_PasswordText, i_pswLenth);
pswControl.Gravity = Gravity.CenterHorizontal;
pswControl.Y = Application.GetRealHeight(81);
frameBack.AddChidren(pswControl);
pswControl.InitControl();
//改变删除按钮的坐标
pswControl.ChangedDeleteButtonPoint(-1, pswControl.Height, false);
//添加关闭按钮
var btnClose = pswControl.AddCloseButton();
btnClose.ButtonClickEvent += (sender, e) =>
{
this.CloseForm();
};
pswControl.FinishInputEvent += (strPsw) =>
{
this.FinishInputEvent?.Invoke(strPsw);
};
}
#endregion
#region ■ 一般方法___________________________
///
/// 设置错误信息
///
///
public void SetErrorMsg(string i_Msg)
{
this.pswControl?.SetErrorMsg(i_Msg);
}
#endregion
#region ■ 界面关闭___________________________
///
/// 界面关闭
///
public override void CloseFormBefore()
{
//取消事件
this.FinishInputEvent = null;
this.pswControl = null;
base.CloseFormBefore();
}
#endregion
}
}