private void sliders_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { if (timer != null && this.IsLoaded) { Effects.CalcRainbow(App.settings.Saturation / 10, App.settings.Lightness / 10); } }
private void sliderSpeed_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { if (timer != null && this.IsLoaded) { timer.Stop(); timer.Interval = TimeSpan.FromMilliseconds(e.NewValue); timer.Start(); Effects.CalcRainbow(App.settings.Saturation / 10, App.settings.Lightness / 10); } }
public RainbowMode() { InitializeComponent(); timer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(App.settings.Speed) }; timer.Tick += Timer_Tick; timer.Start(); GridRainbow.DataContext = App.settings; Effects.CalcRainbow(App.settings.Saturation / 10, App.settings.Lightness / 10); }