private void ViewButton_Click(object sender, RoutedEventArgs e) { TourDetailsWindow td = new TourDetailsWindow(color); td.Top = Window.GetWindow(this).Top; td.Left = Window.GetWindow(this).Left; Window.GetWindow(this).Hide(); td.Main.Content = new TourDetailsPage(tourID, username, color); td.Show(); }
//OPENS TOUR DETAILS PAGE based on --> specific listbox item clicked private void viewBtnClick(object sender, RoutedEventArgs e) { Tour tour = (Tour)(sender as Button).DataContext; //gets tour of the listbox item using the button in the listbox var newWindow = new TourDetailsWindow(color); newWindow.Top = Window.GetWindow(this).Top; newWindow.Left = Window.GetWindow(this).Left; Window.GetWindow(this).Hide(); newWindow.Show(); //Show the new window newWindow.Main.Content = new Pages.TourDetailsPage(tour.TourID, username, color); }
//OPENS TOUR DETAILS PAGE based on --> specific listbox item clicked private void viewBtnClick(object sender, RoutedEventArgs e) { Tour tour = (Tour)(sender as Button).DataContext; var newWindow = new TourDetailsWindow(BorderColor); newWindow.Top = Window.GetWindow(this).Top; newWindow.Left = Window.GetWindow(this).Left; try { newWindow.Main.Content = new Pages.TourDetailsPage(tour.TourID, Username, BorderColor); } catch (Exception ex) { MessageBox.Show(ex.Message); } newWindow.Show(); //Show the new window Application.Current.Windows[0].Hide(); }