using System;
using System.Collections.Generic;
using System.Text;
namespace Shared.Phone.UserCenter
{
///
/// 弹窗型的界面的基层界面
///
public class DialogCommonForm : CommonFormBase
{
#region ■ 变量声明___________________________
///
/// bodyFrameLayout
///
public FrameLayout bodyFrameLayout = null;
///
/// 点击背景的时候,关闭界面
///
public bool CloseFormByClickBack = true;
#endregion
#region ■ 初始化_____________________________
///
/// 初始化界面框架
///
public override void InitForm()
{
base.InitForm();
bodyFrameLayout = new FrameLayout();
bodyFrameLayout.BackgroundColor = UserCenterColor.Current.DialogBackColor;
this.AddChidren(bodyFrameLayout);
bodyFrameLayout.MouseUpEventHandler += (sender, e) =>
{
//关闭自身
this.CloseForm();
};
}
#endregion
#region ■ 添加界面___________________________
///
/// 添加画面,启动参数由指定画面的ShowForm函数所指定
///
/// 启动参数:参数由指定画面的ShowForm函数所指定
public override void AddForm(params object[] parameter)
{
//检测能否追加画面
if (UserCenterLogic.CheckCanAddForm(this) == false)
{
return;
}
var nowForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
if (nowForm == null || (nowForm is ViewGroup) == false)
{
//这种情况应该不存在
this.ShowMassage(ShowMsgType.Error, "ERROR:Not Found The ActionForm!");
return;
}
((ViewGroup)nowForm).AddChidren(this);
//初始化界面框架
this.InitForm();
//执行ShowForm()方法
this.LoadShowFormMethod(parameter);
}
#endregion
}
}