| | |
| | | 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.online) |
| | | { |
| | | 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.online; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | /// <summary> |
| | | /// 更新主页天气 |
| | | /// </summary> |
| | | public static void LoadEvent_RefreshAir() |