private void button1_Click(object sender, RoutedEventArgs e)
 {
     parent.DoStuff();
     this.Close();
 }