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);
}