Пример #1
0
 private void ExecuteAddCommand(string title)
 {
     try
     {
         var index = this.Items.IndexOf(this.SelectedItem);
         var item  = new ViewModels.TodoItemViewModel(_todoItemRepository.Factory(title: title));
         this.TodoList.Items.Insert((index > -1) ? index : 0, item.TodoItem);
         this.Items.Insert((index > -1) ? index : 0, item);
         this.SelectedItem = item;
     }
     catch { this.SelectedItem = null; }
 }