public void AddNewTodo(NewTodoItemViewModel model, KeyEventArgs e)
 {
     if (e.Key == Key.Return && !string.IsNullOrWhiteSpace(model.Text))
     {
         var item = new TodoItem { Text = model.Text, DueDate = model.DueDate, Tags = new BindableCollection<Tag>() };
         this.TodoItems.Add(new TodoItemViewModel(item));
         this.repository.Add(item);
         this.repository.Save();
         model.Clear();
     }
 }
Exemple #2
0
 public void AddNewTodo(NewTodoItemViewModel model, KeyEventArgs e)
 {
     if (e.Key == Key.Return && !string.IsNullOrWhiteSpace(model.Text))
     {
         var item = new TodoItem {
             Text = model.Text, DueDate = model.DueDate, Tags = new BindableCollection <Tag>()
         };
         this.TodoItems.Add(new TodoItemViewModel(item));
         this.repository.Add(item);
         this.repository.Save();
         model.Clear();
     }
 }