private void result1(object sender, RoutedEventArgs e) { r.Name = this.Name1; mainDal r1 = new mainDal(); r1.addResult(r); quizRunResult re = new quizRunResult(); re.setResult(r); this.Close(); re.Show(); }