gxc
2019-11-15 05ce435c3b58e53eeab04c672affdeeab75f3036
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/Base/DialogCommonForm.cs
@@ -15,6 +15,14 @@
        /// bodyFrameLayout
        /// </summary>
        public FrameLayout bodyFrameLayout = null;
        /// <summary>
        /// 点击背景的时候,关闭界面
        /// </summary>
        public bool CloseFormByClickBack = true;
        /// <summary>
        /// 原来的滑动标识
        /// </summary>
        private bool oldScrollEnabled = false;
        #endregion
@@ -24,18 +32,24 @@
        /// 初始化界面框架
        /// </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
@@ -70,5 +84,23 @@
        }
        #endregion
        #region ■ 关闭界面___________________________
        /// <summary>
        /// 关闭界面
        /// </summary>
        public override void CloseForm()
        {
            if (this.oldScrollEnabled == true)
            {
                //如果它原来就是不可以滑动的话,不处理
                UserView.HomePage.Instance.ScrollEnabled = true;
            }
            base.CloseForm();
        }
        #endregion
    }
}