private void AddNewStudentButton_Click(object sender, RoutedEventArgs e) { var addStudnetWindow = new AddStudentWindow(Studies); addStudnetWindow.AddStudent += new AddStudentHandler(AddStudentHandler); addStudnetWindow.ShowDialog(); }
private void DataGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { var dg = sender as DataGrid; var selected = dg.SelectedItem; if (selected != null) { var student = selected as Student; connection.context.Students.Attach(student); var addWindow = new AddStudentWindow(student, Studies); addWindow.ShowDialog(); } }