示例#1
0
        public HomeViewModel()
        {
            _todoServiceClient = BootStrapper.Instance.todoServiceClient;
            _eventAggregator   = App.eventAggregator;
            TodoList           = new ObservableCollection <TodoViewModel>();


            loadTodoList();
            _TodoListSelectedIndex = -1;
            _SelectedTodo          = new TodoViewModel();



            UpdateTodoCmd    = new RelayCommand(ExecUpdateTodo, CanUpdateTodo);
            DeleteTodoCmd    = new RelayCommand(ExecDeleteTodo, CanDeleteTodo);
            LoadTodoCmd      = new RelayCommand(ExecLoadTodo, CanLoadTodo);
            ListTodosCmd     = new RelayCommand(ExecListTodos, CanListTodos);
            AddTodoCmd       = new RelayCommand(ExecAddTodo, CanAddTodo);
            NewTodoCmd       = new RelayCommand(ExecNewTodo, CanNewTodo);
            GoTodoDetailsCmd = new RelayCommand(ExecGoTodoDetails, CanGoTodoDetails);
        }
示例#2
0
 private void resetSelectedTodo()
 {
     SelectedTodo          = new TodoViewModel();
     TodoListSelectedIndex = -1;
     SelectedTodo.IsDirty  = false;
 }
示例#3
0
 private void ExecNewTodo(object obj)
 {
     SelectedTodo          = new TodoViewModel();
     TodoListSelectedIndex = -1;
 }