public BrightnessWindow(Menu menu) { InitializeComponent(); BrightnessSlider.Maximum = BrightnessAdjuster.BRIGHTNESS_MAX; BrightnessSlider.Minimum = BrightnessAdjuster.BRIGHTNESS_MIN; BrightnessSlider.Value = BrightnessAdjuster.getInstance().Brightness; BrightnessSlider.ValueChanged += BrightnessSlider_ValueChanged; this.Width = menu.Width; this.Height = 60; this.Top = menu.Top + menu.Height; this.Left = menu.Left; }
private void Background_KeyDown(object sender, KeyEventArgs e) { if (e.KeyStates == Keyboard.GetKeyStates(Key.Q)) { WindowsHandler.AcquirePriortyofScreenTouch(); } if (e.KeyStates == Keyboard.GetKeyStates(Key.W)) { WindowsHandler.BlockingScreenTouch(); } if (e.KeyStates == Keyboard.GetKeyStates(Key.E)) { YTDataDecoder.run(); } if (e.KeyStates == Keyboard.GetKeyStates(Key.R)) { Console.WriteLine(BrightnessAdjuster.getInstance().Brightness); } }
private void BrightnessSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { BrightnessAdjuster.getInstance().SetBrightness(e.NewValue); }