private void CreateNewEmployee(object sender, ExecutedRoutedEventArgs e) { var employeeDetail = new EmployeeDetail(Application.Current.GetService <IDbContextFactory>()); employeeDetail.Owner = this; employeeDetail.WindowStartupLocation = WindowStartupLocation.CenterOwner; employeeDetail.ShowDialog(); }
private void EditEmployee(int employeeId) { var dbContextFactory = Application.Current.GetService <IDbContextFactory>(); var employeeDetail = new EmployeeDetail(dbContextFactory, employeeId); employeeDetail.Owner = this; employeeDetail.WindowStartupLocation = WindowStartupLocation.CenterOwner; employeeDetail.ShowDialog(); }