private void OpenShowInheritorsForm(object sender, RoutedEventArgs e) { if (dgrid.SelectedItems.Count == 1) { ShowInheritorsForm sif = new ShowInheritorsForm(); Person pp = (Person)dgrid.SelectedItem; sif.Title = "Spadkobiercy - " + pp.Name; sif.DataContext = this.db.personService.GetInheritors(pp); sif.ShowDialog(); } }
private void OpenShowCiugewaAncestors(object sender, RoutedEventArgs e) { if (dgrid.SelectedItems.Count == 2) { ShowInheritorsForm sif = new ShowInheritorsForm(); Person per1 = (Person)dgrid.SelectedItems[0]; Person per2 = (Person)dgrid.SelectedItems[1]; sif.Title = "Wspólni przodkowie"; sif.DataContext = this.db.personService.GetCommonAncestors(per1, per2); sif.ShowDialog(); } }
private void OpenShowInheritorsForm(object sender, RoutedEventArgs e) { if (dgrid.SelectedItems.Count == 1) { ShowInheritorsForm sif = new ShowInheritorsForm(); Person pp = (Person)dgrid.SelectedItem; sif.Title = "Spadkobiercy - "+pp.Name; sif.DataContext = this.db.personService.GetInheritors(pp); sif.ShowDialog(); } }