private void PackIcon_MouseDown(object sender, MouseButtonEventArgs e) { MainWindow window = (MainWindow)Application.Current.MainWindow; window.GridMain.Children.Clear(); UserControlRest restPage = new UserControlRest(); window.GridMain.Children.Add(restPage); }
private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e) { UserControl usc = null; switch (((ListViewItem)((ListView)sender).SelectedItem).Name) { case "ItemHome": GridMain.Children.Clear(); LoadMain().GetAwaiter(); break; case "ItemCreate": GridMain.Children.Clear(); usc = new UserControlRest(); GridMain.Children.Add(usc); break; case "Nearme": GridMain.Children.Clear(); UserControlNear near = new UserControlNear(); near.LoadMap(53.9084091, 27.5732671); GridMain.Children.Add(near); break; case "Find": GridMain.Children.Clear(); usc = new Search(); GridMain.Children.Add(usc); break; case "Account": login = new LoginPage(); login.Show(); break; case "Exit": if (User.LOGIN) { NotificationWindow notificationWindow = new NotificationWindow(); if (notificationWindow.ShowDialog() == true) { User.LOGIN = false; User.UserName = "******"; Username.Text = "Unknow"; this.Admin_button.Visibility = Visibility.Hidden; this.Admin_button.IsEnabled = false; } } break; default: break; } }