wxr
2021-06-09 cb6e11c5067ecaba4d8f9907989154167c1e8943
HDL_ON/UI/UI0-Stan/Form/DeviceFunctionCardCommonForm.cs
@@ -23,6 +23,10 @@
        /// </summary>
        public Action SettionFinishEvent = null;
        /// <summary>
        /// 左右翻页的控件的事件
        /// </summary>
        public Action<int> PageChangeEvent = null;
        /// <summary>
        /// 左右整个翻页的控件
        /// </summary>
        private PageLayout pageLayout = null;
@@ -51,14 +55,14 @@
        /// </summary>
        public NormalFrameLayout FrameWhiteCentet2 = null;
        /// <summary>
        /// 是否显示收藏按钮
        /// <summary>
        /// 是否显示收藏按钮
        /// </summary>
        public bool ShowColltionButton = true;
        #endregion
        #region ■ 初始化_____________________________
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
@@ -95,6 +99,7 @@
            {
                //设置底部两个按钮的状态
                this.SetBottomTwoButtonStatu();
                this.PageChangeEvent?.Invoke(index);
            };
            //初始化第一个索引的桌布
@@ -212,6 +217,10 @@
                this.pageLayout.PageIndex = 0;
                //设置底部两个按钮的状态
                this.SetBottomTwoButtonStatu();
                if (this.FrameWhiteCentet2 != null && this.pageLayout.ScrollEnabled == false)
                {
                    this.pageLayout.ScrollEnabled = true;
                }
            };
            this.btnBottomTwo = new NormalViewControl(14, 6, true);
            btnBottomTwo.X = btnBottomOne.Right + Application.GetRealWidth(8);
@@ -224,6 +233,10 @@
                this.pageLayout.PageIndex = 1;
                //设置底部两个按钮的状态
                this.SetBottomTwoButtonStatu();
                if (this.FrameWhiteCentet2 != null && this.pageLayout.ScrollEnabled == false)
                {
                    this.pageLayout.ScrollEnabled = true;
                }
            };
        }
@@ -248,7 +261,40 @@
        #endregion
        #region ■ 界面关闭___________________________
        /// <summary>
        /// 界面关闭
        /// </summary>
        public override void CloseFormBefore()
        {
            base.CloseFormBefore();
            this.SettionFinishEvent = null;
            this.PageChangeEvent = null;
        }
        #endregion
        #region ■ 一般方法___________________________
        /// <summary>
        /// 获取头部右边的【设置】图标控件
        /// </summary>
        /// <returns></returns>
        public PicViewControl GetTopSettingIcon()
        {
            for (int i = 0; i < topFrameLayout.ChildrenCount; i++)
            {
                var myView = topFrameLayout.GetChildren(i);
                if (myView == null || myView.Name != "btnSetting")
                {
                    continue;
                }
                return myView as PicViewControl;
            }
            return null;
        }
        /// <summary>
        /// 添加头部【设置】的图标
@@ -257,18 +303,20 @@
        /// <param name="btnHigherDeviceName">上一级界面的设备名字控件(原来on的框架太坑)</param>
        private void AddTopSettingIcon(Button btnHigherDeviceName, Button btnHigherRoom)
        {
            //如果是成员没有功能
            //if (DB_ResidenceData.Instance.CurrentRegion.isOtherShare == true)
            //{
            //    return;
            //}
            //设置图标
            //设置图标(门锁界面需要借用这个图标的X轴和Y轴,所以加进来)
            var btnSetting = new PicViewControl(28, 28);
            btnSetting.X = Application.GetRealWidth(337);
            btnSetting.Y = Application.GetRealHeight(9);
            btnSetting.UnSelectedImagePath = "Public/FuncInfoSetIcon.png";
            btnSetting.Name = "btnSetting";
            topFrameLayout.AddChidren(btnSetting);
            //如果是成员没有功能
            if (DB_ResidenceData.Instance.CurrentRegion.isOtherShare == true)
            {
                btnSetting.Visible = false;
            }
            btnSetting.ButtonClickEvent += (sender, e) =>
            {
                var infoView = new UI.FunctionBaseInfoSetPage(this.device, () =>