private void Button_Click(object sender, RoutedEventArgs e) { BindingList <ToDoModel> _ToDoDataOutput = _ToDoDataMonday; for (int i = 3; i < 15; i++) { if (i > 2 && i < 6) { _ToDoDataOutput.Add(_ToDoDataTuesday[i - 3]); } if (i > 5 && i < 9) { _ToDoDataOutput.Add(_ToDoDataWednesday[i - 6]); } if (i > 8 && i < 12) { _ToDoDataOutput.Add(_ToDoDataThursday[i - 9]); } if (i > 11) { _ToDoDataOutput.Add(_ToDoDataFriday[i - 12]); } } try { _fileIOServices.SaveData(_ToDoData); } catch (Exception ex) { MessageBox.Show(ex.Message); Close(); } }
private void _todoData_ListChanged(object sender, ListChangedEventArgs e) { if (e.ListChangedType == ListChangedType.ItemAdded || e.ListChangedType == ListChangedType.ItemDeleted || e.ListChangedType == ListChangedType.ItemChanged) { try { _fileIOServices.SaveData(sender); } catch (Exception ex) { MessageBox.Show(ex.Message); Close(); } } }
private void _todoDataList_ListChanged(object sender, ListChangedEventArgs e) { if (e.ListChangedType == ListChangedType.ItemAdded || e.ListChangedType == ListChangedType.ItemDeleted || e.ListChangedType == ListChangedType.ItemChanged) { try { fileIOService.SaveData(sender); // _todoDataList = fileIOService.LoadData(); } catch (Exception ex) { MessageBox.Show(ex.Message); Close(); } } //throw new NotImplementedException(); }