private void OnEventReceived(EventDispatcher.Event e, object?arg) { Dispatcher.UIThread.Post(async() => { switch (e) { case EventDispatcher.Event.EqualizerToggle: await MessageComposer.SetEqualizer(!_eqSwitch.IsChecked, (EqPreset)_presetSlider.Value, false); _eqSwitch.Toggle(); break; case EventDispatcher.Event.EqualizerNextPreset: _eqSwitch.IsChecked = true; var newVal = _presetSlider.Value + 1; if (newVal >= 5) { newVal = 0; } _presetSlider.Value = newVal; await MessageComposer.SetEqualizer(_eqSwitch.IsChecked, (EqPreset)_presetSlider.Value, false); break; } }); }
private async void EqPreset_OnChanged(object?sender, int e) { await MessageComposer.SetEqualizer(_eqSwitch.IsChecked, (EqPreset)_presetSlider.Value, false); }
private async void EqToggle_OnToggled(object?sender, bool e) { await MessageComposer.SetEqualizer(_eqSwitch.IsChecked, (EqPreset)_presetSlider.Value, false); }