コード例 #1
0
        public BoardViewModel(BoardService boardService)
        {
            this.boardService = boardService;

            ToolBarViewModel = new ElementCreatorToolBarViewModel
            {
                AddCommand    = new RelayCommand(AddCommandExecute),
                EditCommand   = new RelayCommand(EditCommandExecute, EditCommandCanExecute),
                RemoveCommand = new RelayCommand(RemoveCommandExecute, RemoveCommandCanExecute),
            };
        }
コード例 #2
0
        public BoardsViewModel(BoardService boardService, EventAggregator eventAggregator)
        {
            this.boardService    = boardService;
            this.eventAggregator = eventAggregator;

            ToolBarViewModel = new ElementCreatorToolBarViewModel
            {
                AddCommand     = new RelayCommand(AddCommandExecute),
                EditCommand    = new RelayCommand(EditCommandExecute, EditCommandCanExecute),
                RemoveCommand  = new RelayCommand(RemoveCommandExecute, RemoveCommandCanExecute),
                OpenCommand    = new RelayCommand(BoardOpenCommandExecute, BoardOpenCommandCanExecute),
                RefreshCommand = new RelayCommand(RefreshCommandExecute),
            };


            // TODO: Remove
            boardService.CreateDummies();

            Boards = new ObservableCollection <Board>(boardService.GetUserBoards());
        }