public MainAppWindow(User user1) { InitializeComponent(); this.user = user1; user.UserId = DataBaseSolution.GetUserId(user.Username); UserControl usc = null; usc = new UserControlAccount(this); GridMain.Children.Add(usc); }
private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e) { UserControl usc = null; GridMain.Children.Clear(); switch (((ListViewItem)((ListView)sender).SelectedItem).Name) { case "ItemAccount": usc = new UserControlAccount(this); GridMain.Children.Add(usc); break; case "ItemNotebook": usc = new UserControlNotebook(this); GridMain.Children.Add(usc); break; case "ItemFoodPlan": usc = new UserControlFoodPlan(this); GridMain.Children.Add(usc); break; case "ItemProducts": usc = new UserProductsRecipes(this); GridMain.Children.Add(usc); break; case "ItemSearch": usc = new UserControlSearch(); GridMain.Children.Add(usc); break; default: break; } }