Hi,
I can't use IsOn and IsBusy together. If I use IsOn only it's all working. IsBusy is causing some weird state.See screenshot attached.
Both properties are binded in XAML to my ViewModel.
C# from ViewModel :
private async Task RefreshBluetooth(BluetoothState state) {
switch (state) {
case BluetoothState.On:
BluetoothSwitchIsOn = true;
if (BluetoothSwitchIsBusy) {
await Task.Delay(100);
BluetoothSwitchIsBusy = false;
}
break;
case BluetoothState.TurningOn:
BluetoothSwitchIsBusy = true;
await Task.Delay(100);
break;
case BluetoothState.TurningOff:
BluetoothSwitchIsBusy = true;
await Task.Delay(100);
break;
case BluetoothState.Off:
BluetoothSwitchIsOn = false;
if (BluetoothSwitchIsBusy) {
await Task.Delay(100);
BluetoothSwitchIsBusy = false;
}
break;
default:
BluetoothSwitchIsOn = false;
await Task.Delay(250);
BluetoothSwitchIsBusy = false;
break;
}
}
With or without Task.Delay is the same.
Attachment:
switch_ecfe043e.zip