public NewTaskViewModel(ITaskRepository taskRepository) { this.taskRepository = taskRepository; CreateTaskCommand = new DelegateCommand(CreateTask, () => !Saving); CancelCommand = new DelegateCommand(()=> { Owner.DialogResult = false; Owner.Close(); }, ()=>!Saving); TodoItem = new TodoItem(); }
public Task Add(TodoItem todoItem) { return TaskEx.Delay(1500) .ContinueWith(t => tasks.Add(currentId++, todoItem)); }