private void UpdateUiSwitch(Component component, ToggleButton toggleButton) { RunOnUiThread(() => { if (component.DeviceStatus == toggleButton.Checked) return; toggleButton.Checked = component.DeviceStatus; toggleButton.SetTextColor(Color.Green); }); }
private void UpdateUiSwitch(Component component, UISwitch uiSwitch) { InvokeOnMainThread(() => { if (component.DeviceStatus == uiSwitch.On) return; uiSwitch.SetState(component.DeviceStatus, true); }); }