private void editButton_Click(object sender, RoutedEventArgs e)
 {
     if (estate == null)
         System.Windows.MessageBox.Show("Estate is empty (wtf?)");
     else
     {
         UpdateEstate estateUpdateDialog = new UpdateEstate(estate);
         estateUpdateDialog.ShowDialog();
     }
 }
 private void update_Click(object sender, RoutedEventArgs e)
 {
     Estate selected = EditEstatee.SelectedItem as Estate;
     if (selected == null)
         System.Windows.MessageBox.Show("You must select a student");
     else
     {
         UpdateEstate estate = new UpdateEstate(selected);
         estate.ShowDialog();
     }
 }