wxr
2022-03-18 8aa777aedd7492b7f2e28a172c2874f4ee7366a1
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -10,6 +10,52 @@
    public partial class HomePage
    {
        /// <summary>
        /// 更新设备在线状态
        /// </summary>
        public static void LoadEvent_RefreshDevcieOnline(Function function)
        {
            Application.RunOnMainThread(() =>
            {
                if (bodyView != null)
                {
                    foreach (var view in bodyView.functionViews)
                    {
                        if (view.Tag.ToString() == function.sid)
                        {
                            for (int i = 0; i < view.ChildrenCount; i++)
                            {
                                if (view.GetChildren(i).GetType() == typeof(Button))
                                {
                                    var btn = view.GetChildren(i) as Button;
                                    if(btn.Tag == null)
                                    {
                                        continue;
                                    }
                                    if (btn.Tag.ToString() == function.sid)
                                    {
                                        if (function.online2d)
                                        {
                                            btn.UnSelectedImagePath = "Collection/Functionbg.png";
                                            btn.IsSelected = false;
                                        }
                                        else
                                        {
                                            btn.UnSelectedImagePath = "Collection/FunctionOfflineBg.png";
                                            btn.IsSelected = false;
                                        }
                                    }
                                    else if (btn.Tag.ToString() == "OnlineTag")
                                    {
                                        btn.Visible = !function.online2d;
                                    }
                                }
                            }
                        }
                    }
                }
            });
        }
        /// <summary>
        /// 更新主页天气
        /// </summary>
        public static void LoadEvent_RefreshAir()
@@ -468,7 +514,7 @@
        {
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)//离线不允许操作
                if (!function.online2d)//离线不允许操作
                {
                    new Tip()
                    {
@@ -531,7 +577,7 @@
        {
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)//离线不允许操作
                if (!function.online2d)//离线不允许操作
                {
                    new Tip()
                    {
@@ -575,7 +621,7 @@
        {
            btnClose.MouseUpEventHandler = (sender, e) =>
            {
                if (!curtain.online)//离线不允许操作
                if (!curtain.online2d)//离线不允许操作
                {
                    new Tip()
                    {
@@ -595,7 +641,7 @@
            btnOpen.MouseUpEventHandler = (sender, e) =>
            {
                if (!curtain.online)//离线不允许操作
                if (!curtain.online2d)//离线不允许操作
                {
                    new Tip()
                    {
@@ -625,7 +671,7 @@
            };
            btnUp.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)//离线不允许操作
                if (!function.online2d)//离线不允许操作
                {
                    new Tip()
                    {
@@ -656,7 +702,7 @@
            };
            btnDown.MouseUpEventHandler = (sender, e) =>
            {
                if (!function.online)//离线不允许操作
                if (!function.online2d)//离线不允许操作
                {
                    new Tip()
                    {