Esempio n. 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();
 }
Esempio n. 2
0
 public Task Add(TodoItem todoItem)
 {
     return TaskEx.Delay(1500)
         .ContinueWith(t => tasks.Add(currentId++, todoItem));
 }