黄学彪
2020-04-28 e22fdb94322e6cec38e5e4a9aec13d431a133fde
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/NormalControls/MessageManagementControl.cs
@@ -14,23 +14,28 @@
        /// </summary>
        public MessageManagementControl()
        {
            this.Height = Application.GetMinRealAverage(69);
            this.Width = Application.GetMinRealAverage(69);
            this.Height = this.GetPictrueRealSize(69);
            this.Width = this.GetPictrueRealSize(69);
            this.UnSelectedImagePath = "Item/MessageManagement.png";
            this.SelectedImagePath = "Item/MessageManagementSelected.png";
            this.ButtonClickEvent += (sender, e) =>
            {
                //点击后,清空状态
                this.IsSelected = false;
                ControlCommonResourse.HadNewMessage = false;
                var form = new UserMain.MessageManagementForm();
                form.AddForm();
            };
            //添加缓存
            ControlCommonResourse.listMessageManaContr.Add(this);
            //刷新状态
            this.RefreshStatu();
            //如果住宅为虚拟住宅,则此功能无效
            if (Common.Config.Instance.Home.IsVirtually == false)
            {
                this.ButtonClickEvent += (sender, e) =>
                {
                    //点击后,清空状态
                    this.IsSelected = false;
                    ControlCommonResourse.HadNewMessage = false;
                    var form = new UserMain.MessageManagementForm();
                    form.AddForm();
                };
                //添加缓存
                ControlCommonResourse.listMessageManaContr.Add(this);
                //刷新状态
                this.RefreshStatu();
            }
        }
        /// <summary>
@@ -38,6 +43,12 @@
        /// </summary>
        public void RefreshStatu()
        {
            //如果住宅为虚拟住宅,则此功能无效
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                return;
            }
            if (ControlCommonResourse.HadNewMessage == true)
            {
                //如果已经有新消息过来了,就不用读了