private void Application_Startup(object sender, StartupEventArgs e) { //manage suggestion _shopping = My_storage.ReadXML <List <shopping> >("suggesteditems.xml"); if (_shopping == null) { _shopping = new List <shopping>(); } //manage shopping list _manageshoppings = My_storage.ReadXML <ObservableCollection <manageShopping> >("shoppinglist.xml"); if (_manageshoppings == null) { _manageshoppings = new ObservableCollection <manageShopping>(); } //manage fridge // groceries = new ObservableCollection<Grocery>(); _question = MyStorage.ReadXml <ObservableCollection <Question> >("questions.xml"); groceries = My_storage.ReadXML <ObservableCollection <Grocery> >("grocery.xml"); if (groceries == null) { groceries = new ObservableCollection <Grocery>(); } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { Owner.Visibility = Visibility.Visible; My_storage.writeXML <ObservableCollection <manageShopping> >(App._manageshoppings, "shoppinglist.xml"); // My_storage.writeXML<List<shopping>>(App._shopping, "suggesteditems.xml"); }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { My_storage.writeXML <ObservableCollection <Grocery> >(App.groceries, "grocery.xml"); }