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