private void OpenShowTree(object sender, RoutedEventArgs e) { if (dgrid.SelectedItems.Count == 1) { ShowTree st = new ShowTree(); var listaLudzi = new List <IGeneticTreeNode>() { }; Person per = (Person)dgrid.SelectedItem; listaLudzi.Add(per); this.db.personService.GetSomeonesDescendants(listaLudzi, per); st.DataContext = listaLudzi; st.ShowDialog(); } else { ShowTree st = new ShowTree(); var listaLudzi = new List <IGeneticTreeNode>() { }; listaLudzi.AddRange(this.db.personService.GetPeople()); st.DataContext = listaLudzi; st.ShowDialog(); } }
private void OpenShowTree(object sender, RoutedEventArgs e) { if (dgrid.SelectedItems.Count == 1) { ShowTree st = new ShowTree(); var listaLudzi = new List<IGeneticTreeNode>() { }; Person per = (Person)dgrid.SelectedItem; listaLudzi.Add(per); this.db.personService.GetSomeonesDescendants(listaLudzi, per); st.DataContext = listaLudzi; st.ShowDialog(); } else { ShowTree st = new ShowTree(); var listaLudzi = new List<IGeneticTreeNode>() { }; listaLudzi.AddRange( this.db.personService.GetPeople()); st.DataContext = listaLudzi; st.ShowDialog(); } }