private void AddButton_Click(object sender, RoutedEventArgs e) { try { bl.addGuestRequest(guestRequest); ((MainWindow)System.Windows.Application.Current.MainWindow).GuestFilter(this, new RoutedEventArgs()); DialogResult = true; this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }