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); }
private void resetSelectedTodo() { SelectedTodo = new TodoViewModel(); TodoListSelectedIndex = -1; SelectedTodo.IsDirty = false; }
private void ExecNewTodo(object obj) { SelectedTodo = new TodoViewModel(); TodoListSelectedIndex = -1; }