private async Task OnSliderValueChanged(int index, double newValue) { // for Cut mode if (IsSliderActive[index].Value) { // Cancel deactivation (Keep 1.0) if (SliderValue[index].Value < 1.0) { SliderValue[index].Value = 1.0; } return; } if (newValue < Epsilon) { // Do nothing return; } // Change active slider for (var i = 0; i < SliderValue.Length; i++) { IsSliderActive[i].Value = (i == index); } for (var i = 0; i < SliderValue.Length; i++) { SliderValue[i].Value = IsSliderActive[i].Value ? 1.0 : 0.0; } await ConnectedDevice.SwitchCut(index); }