private void extra_Click(object sender, RoutedEventArgs e) { if (this.dueDateBox.SelectedDate == null || this.amountBox.Text == "" || this.interestBox.Text == "" || this.frequencyBox.SelectedIndex == -1 || this.rb1Box.Text == "" && this.rb2Box.Text == "") { string msgtext = "Cannot apply extra principle.\n\nEnter mortgage information for all required fields."; string txt = "Error"; MessageBoxButton button = MessageBoxButton.OKCancel; MessageBoxResult result = MessageBox.Show(msgtext, txt, button); switch (result) { case MessageBoxResult.OK: break; case MessageBoxResult.Cancel: break; } } else { ExtraPrinciple extraForm = new ExtraPrinciple(this.amountBox.Text, this.interestBox.Text, this.frequencyBox.SelectionBoxItem, this.rb1Box.Text, this.rb2Box.Text, this.dueDateBox.SelectedDate); this.NavigationService.Navigate(extraForm); } }
private void extra_Click(object sender, RoutedEventArgs e) { ExtraPrinciple extraForm = new ExtraPrinciple(); this.NavigationService.Navigate(extraForm); }