黄学彪
2020-07-06 f23ad1b3f9f6193f35f72104d690b21dc67d5c1f
ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs
@@ -170,7 +170,8 @@
                    selectHouse.Init();
                    selectHouse.HouseAction = (houseId) =>
                    {
                        ChangeResidence(HdlResidenceLogic.Current.GetHouseByHouseId(houseId));
                        //切换住宅
                        this.ChangeResidence(HdlResidenceLogic.Current.GetHouseByHouseId(houseId));
                    };
                }
            };
@@ -1055,36 +1056,21 @@
        /// <param name="home">Home.</param>
        private void ChangeResidence(House home)
        {
            try
            HdlThreadLogic.Current.RunThread(() =>
            {
                CommonPage.Loading.Start();
                new System.Threading.Thread(async () =>
                {
                    Config.Instance.HomeId = home.Id;
                    Config.Instance.Home = HdlResidenceLogic.Current.GetHouseByHouseId(home.Id);
                    Global.CreateHomeDirectory(home.Id);
                    Config.Instance.Save();
                    //刷新个人中心的内存及线程
                    await UserCenterLogic.InitUserCenterMenmoryAndThread();
                this.ShowProgressBar();
                    Application.RunOnMainThread(() =>
                    {
                        //刷新界面
                        this.ShowForm();
                //切换住宅
                HdlResidenceLogic.Current.SwitchResidence(home.Id);
                        CommonPage.Loading.Hide();
                    });
                })
                { IsBackground = true }.Start();
            }
            catch (Exception ex)
            {
                Application.RunOnMainThread(() =>
                HdlThreadLogic.Current.RunMain(() =>
                {
                    CommonPage.Loading.Hide();
                    Console.WriteLine(ex.Message);
                    //刷新界面
                    this.ShowForm();
                    this.CloseProgressBar();
                });
            }
            });
        }
        #endregion
@@ -1151,10 +1137,8 @@
                    string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report);
                    if (this.dicDeviceCardControl.ContainsKey(mainKeys) == true)
                    {
                        //本地设备对象
                        var locadevice = LocalDevice.Current.GetDevice(mainKeys);
                        //刷新卡片信息
                        this.dicDeviceCardControl[mainKeys].RefreshControlInfo(locadevice);
                        //开启卡片闪烁特效
                        this.dicDeviceCardControl[mainKeys].StartCardLightAppeal();
                    }
                }, ShowErrorMode.NO);