黄学彪
2020-02-21 bd46c57c77c276014db3192a4e2cc96e23c93202
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/Base/DialogCommonForm.cs
@@ -9,37 +9,47 @@
    /// </summary>
    public class DialogCommonForm : CommonFormBase
    {
        #region ■ 变量声明___________________________
        /// <summary>
        /// bodyFrameLayout
        /// </summary>
        #region ■ 变量声明___________________________
        /// <summary>
        /// bodyFrameLayout
        /// </summary>
        public FrameLayout bodyFrameLayout = null;
        /// <summary>
        /// 点击背景的时候,关闭界面
        /// </summary>
        public bool CloseFormByClickBack = true;
        /// <summary>
        /// 原来的滑动标识
        /// </summary>
        private bool oldScrollEnabled = false;
        #endregion
        #region ■ 初始化_____________________________
        #region ■ 初始化_____________________________
        /// <summary>
        /// 初始化界面框架
        /// </summary>
        public override void InitForm()
        {
            base.InitForm();
            bodyFrameLayout = new FrameLayout();
            bodyFrameLayout.BackgroundColor = UserCenterColor.Current.DialogBackColor;
        /// <summary>
        /// 初始化界面框架
        /// </summary>
        public override void InitForm()
        {
            this.oldScrollEnabled = UserView.HomePage.Instance.ScrollEnabled;
            UserView.HomePage.Instance.ScrollEnabled = false;
            base.InitForm();
            bodyFrameLayout = new FrameLayout();
            bodyFrameLayout.BackgroundColor = UserCenterColor.Current.DialogBackColor;
            this.AddChidren(bodyFrameLayout);
            bodyFrameLayout.MouseUpEventHandler += (sender, e) =>
            if (CloseFormByClickBack == true)
            {
                //关闭自身
                this.CloseForm();
            };
                bodyFrameLayout.MouseUpEventHandler += (sender, e) =>
                {
                    //关闭自身
                    this.CloseForm();
                };
            }
        }
        #endregion
@@ -52,10 +62,12 @@
        /// <param name="parameter">启动参数:参数由指定画面的ShowForm函数所指定</param>
        public override void AddForm(params object[] parameter)
        {
            //检测能否追加画面
            if (UserCenterLogic.CheckCanAddForm(this) == false)
            {
                return;
            base.AddForm(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)
@@ -74,5 +86,23 @@
        }
        #endregion
        #region ■ 关闭界面___________________________
        /// <summary>
        /// 关闭界面
        /// </summary>
        public override void CloseFormBefore()
        {
            if (this.oldScrollEnabled == true)
            {
                //如果它原来就是不可以滑动的话,不处理
                UserView.HomePage.Instance.ScrollEnabled = true;
            }
            base.CloseFormBefore();
        }
        #endregion
    }
}