Пример #1
0
        public MainWindow()
        {
            InitializeComponent();
            Topmost            = true;
            LostKeyboardFocus += new KeyboardFocusChangedEventHandler(lostKeyboardFocus);
            Window window = Window.GetWindow(this);
            var    wih    = new WindowInteropHelper(window);
            IntPtr hWnd   = wih.Handle;

            brightnessControl = new BrightnessControl(hWnd);
            InitializeSliders(brightnessControl.GetMonitors());

            SourceChord.FluentWPF.ResourceDictionaryEx.GlobalTheme = SourceChord.FluentWPF.ElementTheme.Dark;

            var w = System.Windows.SystemParameters.PrimaryScreenWidth;
            var h = System.Windows.SystemParameters.PrimaryScreenHeight;

            var taskBarHeight = h - System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;

            Top  = h - HEIGHT - taskBarHeight;
            Left = w - WIDTH;

            var tray = new Tray(this);

            Hide();
        }
Пример #2
0
        public Scroll(BrightnessControl brightnessControl)
        {
            InitializeComponent();
            this.brightnessControl = brightnessControl;

            MySlider.Value = Properties.Settings.Default.Brightness;

            //(Properties.Settings.Default.Brightness);
        }
Пример #3
0
        public MainWindow()
        {
            InitializeComponent();
            Window window = Window.GetWindow(this);
            var    wih    = new WindowInteropHelper(window);
            IntPtr hWnd   = wih.Handle;

            brightnessControl = new BrightnessControl(hWnd);
            InitializeSliders(brightnessControl.GetMonitors());
        }
Пример #4
0
 public MainWindow()
 {
     InitializeComponent();
     brightnessControl = new BrightnessControl();
     InitializeSliders(brightnessControl.GetMonitors());
 }