Beispiel #1
0
        public MainSupervisor(MainModel model, MainWindow view, GlobalKeyboardHook keyboardHook, SettingsController settings, HelpWindow helpWindow)
        {
            _model = model;
            _view  = view;

            _view.DataContext = model;

            _model.CapsStateChanged += OnModelCapsStateChanged;

            _keyboardHook        = keyboardHook;
            _keyboardHook.KeyUp += OnKeyUp;

            _model.SetCapsState(KeyboardHelper.IsCapsKeyLocked(), CapsStateSource.CapsKey);

            _settings = settings;
            _model.SettingsPressed = new RelayCommand(OnSettingsPressed);

            _helpWindow = helpWindow;

            _model.HelpPressed     = new RelayCommand(OnHelpPressed);
            _model.MinimisePressed = new RelayCommand(OnMinimisePressed);
            _model.ClosePressed    = new RelayCommand(OnClosePressed);
        }