public MainViewModel(IShowMessageService showMessageService, IBooksService booksService)
        {
            _showMessageService = showMessageService;
            _booksService       = booksService;
            RefreshBooksAsync();

            MessageCommand = new RelayCommand(OnMessage);
        }
        public BooksViewModel(IBooksService booksService,
                              IShowMessageService messageService)
        {
            _booksService   = booksService ?? throw new ArgumentNullException(nameof(booksService));
            _messageService = messageService ?? throw new ArgumentNullException(nameof(messageService));

            LoadBooksCommand   = new DelegateCommand(LoadBooks);
            AddBookCommand     = new DelegateCommand(AddBook, CanAddBook);
            ShowMessageCommand = new DelegateCommand(ShowMessage);
        }
예제 #3
0
        public BooksViewModel(IBooksService booksService,
                              IEventAggregator eventAggregator,
                              IShowMessageService messageService)
        {
            _booksService    = booksService ?? throw new ArgumentNullException(nameof(booksService));
            _eventAggregator = eventAggregator ?? throw new ArgumentNullException(nameof(eventAggregator));
            _messageService  = messageService ?? throw new ArgumentNullException(nameof(messageService));

            RefreshCommand     = new DelegateCommand(LoadBooks);
            AddBookCommand     = new DelegateCommand(AddBook, CanAddBook);
            ShowMessageCommand = new DelegateCommand(ShowMessage);
        }
예제 #4
0
 /// <summary>
 /// こ
 /// </summary>
 public BasePanelViewModel(IConfigService config, IShowMessageService message)
     : base(config, message)
 {
     this.F01ButtonCommand = new RelayCommand(this.F01Command, this.F01CanExecute);
     this.F02ButtonCommand = new RelayCommand(this.F02Command, this.F02CanExecute);
     this.F03ButtonCommand = new RelayCommand(this.F03Command, this.F03CanExecute);
     this.F04ButtonCommand = new RelayCommand(this.F04Command, this.F04CanExecute);
     this.F05ButtonCommand = new RelayCommand(this.F05Command, this.F05CanExecute);
     this.F06ButtonCommand = new RelayCommand(this.F06Command, this.F06CanExecute);
     this.F07ButtonCommand = new RelayCommand(this.F07Command, this.F07CanExecute);
     this.F08ButtonCommand = new RelayCommand(this.F08Command, this.F08CanExecute);
     this.F09ButtonCommand = new RelayCommand(this.F09Command, this.F09CanExecute);
     this.F10ButtonCommand = new RelayCommand(this.F10Command, this.F10CanExecute);
     this.F11ButtonCommand = new RelayCommand(this.F11Command, this.F11CanExecute);
     this.F12ButtonCommand = new RelayCommand(this.F12Command, this.F12CanExecute);
 }
예제 #5
0
        public MainViewModel(IShowMessageService showMessageService)
        {
            _showMessageService = showMessageService;

            MessageCommand = new DelegateCommand(OnMessage);
        }