private void NotifyIcon_Click(object sender, EventArgs e) { if (brightnessTimeout != null) { brightnessTimeout.Cancel(); } grid_toggler.Visibility = Visibility.Visible; grid_slider.Visibility = Visibility.Collapsed; Visibility = Visibility.Visible; Left = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - 264 - 64; Top = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - 148; }
private void brightnessSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { if (brightnessTimeout != null) { brightnessTimeout.Cancel(); } brightnessTimeout = new DispatcherTimeout(RefreshBrightness, CHANGE_DELAY); ScheduleHiding(); }