Exemplo n.º 1
0
        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)
 {
     MyStorage.WriteXml <ObservableCollection <Question> >(App._question, "questions.xml");
     Owner.Visibility = Visibility.Visible;
 }