黄学彪
2020-04-02 9904031f5291daaf56985146bb671f25e18ebbdf
ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
@@ -280,7 +280,7 @@
                        case 1:
                            {
                                var deviceinof = Method.GetCommonDevice(conditions["MacAddr"], conditions["Epoint"]);
                                name = deviceinof.DeviceEpointName;
                                name = LocalDevice.Current.GetDeviceEpointName(deviceinof);
                                selecteddevice.regionNameBtn.Visible = true;
                                Method.RoomNmae(selecteddevice.regionNameBtn, deviceinof);
@@ -450,7 +450,7 @@
                                                {
                                                    if (Common.Logic.CurrentLogic.Accounts[a]["UserId"] == conditions["AttriButeData2"])
                                                    {
                                                        state = Common.Logic.CurrentLogic.Accounts[a]["Account"];
                                                        state = Common.Logic.CurrentLogic.Accounts[a]["AccountName"];
                                                        break;
                                                    }
@@ -660,10 +660,11 @@
                        alert.ConfirmClickEvent += () =>
                        {
                            Common.Logic.CurrentLogic.Conditions.Remove(conditions);
                            var logicCommunalPage = new LogicCommunalPage();
                            UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                            UserView.HomePage.Instance.PageIndex += 1;
                            logicCommunalPage.Show(() => { });
                            selecteddevice.selecetdFrameLayout.RemoveFromParent();
                            //var logicCommunalPage = new LogicCommunalPage();
                            //UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                            //UserView.HomePage.Instance.PageIndex += 1;
                            //logicCommunalPage.Show(() => { });
                        };
                    };
@@ -724,7 +725,7 @@
                            {
                                var deviceinof = Method.GetCommonDevice(actions["DeviceAddr"].ToString(), actions["Epoint"].ToString());
                                name = deviceinof.DeviceEpointName;
                                name = LocalDevice.Current.GetDeviceEpointName(deviceinof);
                                actiondevice.regionNameBtn.Visible = true;
                                Method.RoomNmae(actiondevice.regionNameBtn, deviceinof);
                                switch (deviceinof.Type)
@@ -1151,11 +1152,12 @@
                        alert.ConfirmClickEvent += () =>
                        {
                            Common.Logic.CurrentLogic.Actions.Remove(actions);
                            actiondevice.selecetdFrameLayout.RemoveFromParent();
                            // devicesFrameLayout.RemoveFromParent();
                            var logicCommunalPage = new LogicCommunalPage();
                            UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                            UserView.HomePage.Instance.PageIndex += 1;
                            logicCommunalPage.Show(() => { });
                            //var logicCommunalPage = new LogicCommunalPage();
                            //UserView.HomePage.Instance.AddChidren(logicCommunalPage);
                            //UserView.HomePage.Instance.PageIndex += 1;
                            //logicCommunalPage.Show(() => { });
                        };
                    };
@@ -1324,50 +1326,7 @@
            };
        }
        /// <summary>
        /// 闪现式提示框的方法
        /// </summary>
        /// <param name="tipText">提示内容</param>
        /// <param name="second">停留时间单位为s</param>
        public void TipView(string tipText, int second = 1)
        {
            var frameLayout = new FrameLayout { BackgroundColor = 0x50000000 };
            this.AddChidren(frameLayout);
            var btn = new Button
            {
                Gravity = Gravity.Center,
                Text = tipText,
                BackgroundColor = 0xff1f1f1f,
                Width = Application.GetRealWidth(500),
                Height = Application.GetRealHeight(100),
                Radius = (uint)Application.GetRealHeight(50),
            };
            frameLayout.AddChidren(btn);
            var dateTime1 = DateTime.Now;
            new System.Threading.Thread(() =>
            {
                Application.RunOnMainThread(() =>
                {
                    while (true)
                    {
                        if ((DateTime.Now - dateTime1).TotalMilliseconds > second * 1000)
                        {
                            //默认一秒关闭
                            frameLayout.RemoveFromParent();
                            break;
                        }
                    }
                });
            })
            { IsBackground = true }.Start();
        }
    }
}