private void Application_Startup(object sender, StartupEventArgs e) { //GenerateCustomers _customers = MyStorage.ReadXml <ObservableCollection <Customer> >("customers.xml"); if (_customers == null) { _customers = new ObservableCollection <Customer>(); // _customers = GenerateCustomers(10); } //GenerateFood _foods = MyStorage.ReadXml <ObservableCollection <Food> >("foods.xml"); if (_foods == null) { _foods = new ObservableCollection <Food>(); // _foods = GenerateFoods(5); } //GenerateDEcorations&Movables _decorations = MyStorage.ReadXml <ObservableCollection <Decoration> >("decorations.xml"); if (_decorations == null) { _decorations = new ObservableCollection <Decoration>(); // _decorations = GenerateDecorations(10); } //Generate Planned Parties _parties = MyStorage.ReadXml <ObservableCollection <Party> >("parties.xml"); if (_parties == null) { _parties = new ObservableCollection <Party>(); //_parties = GenerateParties(10); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { CoBx_responsiblePerson.ItemsSource = new List <String> { "Employee Name 1", "Employee Name 2", "Employee Name 3", "Employee Name 4" }; CoBx_catering.ItemsSource = new List <string> { "Sit-Down", "Buffet" }; CoBx_partyType.ItemsSource = new List <String> { "Birthday", "Anniversary" }; CoBx_foodCategory.ItemsSource = new List <String> { "Main Course", "Drinks", "Dessert" }; CoBx_decorCategory.ItemsSource = new List <String> { "Movables", "Decorations" }; Tbl_name.Text = cstName; //Constructor customer foods = MyStorage.ReadXml <ObservableCollection <Food> >("foods.xml"); decorations = MyStorage.ReadXml <ObservableCollection <Decoration> >("decorations.xml"); customers = MyStorage.ReadXml <ObservableCollection <Customer> >("customers.xml"); //_parties = MyStorage.ReadXml<ObservableCollection<Party>>("paties.xml"); }
private void Application_Exit(object sender, ExitEventArgs e) { MyStorage.WriteXml <ObservableCollection <Customer> >(_customers, "customers.xml"); MyStorage.WriteXml <ObservableCollection <Food> >(_foods, "foods.xml"); MyStorage.WriteXml <ObservableCollection <Decoration> >(_decorations, "decorations.xml"); // MyStorage.WriteXml < ObservableCollection >> (_parties, "parties.xml"); }