BrightnessTray.MainWindow.Slider_ValueChanged C# (CSharp) Метод

Slider_ValueChanged() приватный Метод

Change the monitor brightness when the slider value changes.
private Slider_ValueChanged ( object sender, RoutedPropertyChangedEventArgs e ) : void
sender object
e RoutedPropertyChangedEventArgs
Результат void
        private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            var newBrightness = (int) e.NewValue;

            // Change the brightness in a background thread to avoid UI blocking
            new Thread((data) =>
            {
                WmiFunctions.SetBrightnessLevel((int) newBrightness);

            }).Start();

            this.percentageLabel.Content = newBrightness.ToString() + "%";
            DrawIcon.updateNotifyIcon(NotifyIcon, newBrightness);
        }