private void Button_Click(object sender, RoutedEventArgs e) { FrameworkElement fe = sender as FrameworkElement; MonitorData monitor = ((MonitorData)fe.DataContext); monitor.SwitchPower(); manager.ChangePower(monitor.Ref.hPhysicalMonitor, monitor.IsPoweredOn); }
private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { FrameworkElement fe = sender as FrameworkElement; MonitorData monitor = ((MonitorData)fe.DataContext); monitor.Ref.BrightnessLevel = (uint)e.NewValue; manager.ChangeBrightness(monitor.Ref.hPhysicalMonitor, monitor.BrightnessLevel); }