Example #1
0
        /// <summary>
        /// Initializes an instance of <see cref="MainWindowVM"/>.
        /// </summary>
        /// <param name="dataService"></param>
        /// <param name="performer"></param>
        /// <param name="dialogService"></param>
        public MainWindowVM(IDataService dataService, PerformService performer, IDialogService dialogService)
        {
            if (dataService == null)
            {
                throw new ArgumentNullException(nameof(dataService));
            }
            if (performer == null)
            {
                throw new ArgumentNullException(nameof(performer));
            }
            if (dialogService == null)
            {
                throw new ArgumentNullException(nameof(dialogService));
            }

            _gameDataService = dataService;
            _performer       = performer;
            _dialogService   = dialogService;

            _performer.PropertyChanged += _performer_PropertyChanged;

            LoadData();

            LoadCommands();
        }
        /// <summary>
        /// Инициализация класса <see cref="EditKeyBindingVM"/>.
        /// </summary>
        /// <param name="performService"></param>
        public EditKeyBindingVM(PerformService performService)
        {
            if (performService == null)
            {
                throw new ArgumentNullException(nameof(performService));
            }

            _performer = performService;
            _performer.PerformEnable = false;

            _performer.HotKey = (Keys)_keysConverter.ConvertFromString(Properties.Settings.Default["HotKey"].ToString());

            KeyBinding = _performer.HotKey.ToString();
        }
Example #3
0
        /// <summary>
        /// Initializes an instance of <see cref="GameWindowVM"/>.
        /// </summary>
        /// <param name="performer"></param>
        /// <param name="dialogService"></param>
        public GameWindowVM(PerformService performer, IDialogService dialogService)
        {
            if (performer == null)
            {
                throw new ArgumentNullException(nameof(performer));
            }
            if (dialogService == null)
            {
                throw new ArgumentNullException(nameof(dialogService));
            }

            _performer     = performer;
            _dialogService = dialogService;

            Messenger.Default.Register <Game>(this, OnGameReceived);

            _performer.PropertyChanged += Performer_PropertyChanged;
        }