Пример #1
0
 private void UpdateUiSwitch(Component component, ToggleButton toggleButton)
 {
     RunOnUiThread(() =>
     {
         if (component.DeviceStatus == toggleButton.Checked) return;
         toggleButton.Checked = component.DeviceStatus;
         toggleButton.SetTextColor(Color.Green);
     });
 }
Пример #2
0
 private void UpdateUiSwitch(Component component, UISwitch uiSwitch)
 {
     InvokeOnMainThread(() =>
     {
         if (component.DeviceStatus == uiSwitch.On) return;
         uiSwitch.SetState(component.DeviceStatus, true);
     });
 }