public Wniosek1(EquivalentApplication Application) { InitializeComponent(); application = Application; spContext.DataContext = application; dgRescuers.ItemsSource = application.Units; }
private void btnEquivalentMenu3_Click(object sender, RoutedEventArgs e) { try { foreach (Druh item in zastep) { item.IleAkcji++; } int counter = 1; foreach (Unit item in units) { item.ID = counter; counter++; } EquivalentApplication application = new EquivalentApplication((DateTime)dpEquivalentOccurrence.SelectedDate, units, tbRecordNumber.Text, tbOccurenceName.Text, (DateTime)dpApplication.SelectedDate); wniosek = new Wniosek1(application); wniosek.Show(); } catch (Exception) { MessageBox.Show("Nie wypełniono wszystkich wymaganych pól.", "Erroł", MessageBoxButton.OK, MessageBoxImage.Error); } }