void MainWindow_Loaded(object sender, RoutedEventArgs e) { // Prepare the task creation panel PriorityComboBox.ItemsSource = TodoItemFlags.PriorityFlags; _NewTodo = new TodoItem { Priority = PriorityFlag.Normal, DueDate = DateTime.Today }; NewItemPanel.DataContext = _NewTodo; _Proxy = new TodoListServiceProxy("default"); try { _ToDoItems = _Proxy.GetItems(); foreach (TodoItem item in _ToDoItems) { item.PropertyChanged += Item_PropertyChanged; } TodoDataGrid.ItemsSource = _ToDoItems; } catch (Exception ex) { MessageBox.Show(ex.ToString()); throw; } }
void MainWindow_Loaded(object sender, RoutedEventArgs e) { // Prepare the task creation panel PriorityComboBox.ItemsSource = TodoItemFlags.PriorityFlags; _NewTodo = new TodoItem { Priority = PriorityFlag.Normal, DueDate = DateTime.Today }; NewItemPanel.DataContext = _NewTodo; _Proxy = new TodoListServiceProxy("default"); try { _ToDoItems = _Proxy.GetItems(); foreach (TodoItem item in _ToDoItems) { item.PropertyChanged += Item_PropertyChanged; } TodoDataGrid.ItemsSource = _ToDoItems; } catch (Exception ex) { MessageBox.Show(ex.ToString()); throw; } }