private void OpenAddRelationForm(object sender, RoutedEventArgs e)
        {
            var arfvm = new AddRelationFormViewModel();

            arfvm.People     = new List <IGeneticTreeNode>();
            arfvm.MainPerson = (Person)this.dgrid.SelectedItem;

            arfvm.AddingChild = true;
            if (db.personService.GetParent(Sex.Male, arfvm.MainPerson) != null)
            {
                arfvm.AddingFather = false;
                arfvm.GotFather    = true;
            }
            else
            {
                arfvm.AddingFather = true;
            }
            if (db.personService.GetParent(Sex.Female, arfvm.MainPerson) != null)
            {
                arfvm.AddingMather = false;
                arfvm.GotMother    = true;
            }
            else
            {
                arfvm.AddingMather = true;
            }



            AddRelationForm arf = new AddRelationForm(db, arfvm);

            arf.DataContext = arfvm;
            arf.ShowDialog();
            LoadEntities();
        }
        private void OpenAddRelationForm(object sender, RoutedEventArgs e)
        {


            var arfvm = new AddRelationFormViewModel();

            arfvm.People = new List<IGeneticTreeNode>();
            arfvm.MainPerson = (Person)this.dgrid.SelectedItem;

            arfvm.AddingChild = true;
            if (db.personService.GetParent(Sex.Male, arfvm.MainPerson) != null)
            {
                arfvm.AddingFather = false;
                arfvm.GotFather = true;
            }
            else
            {
                arfvm.AddingFather = true;
            }
            if (db.personService.GetParent(Sex.Female, arfvm.MainPerson) != null)
            {
                arfvm.AddingMather = false;
                arfvm.GotMother = true;
            }
            else
            {
                arfvm.AddingMather = true;
            }



            AddRelationForm arf = new AddRelationForm(db, arfvm);

            arf.DataContext = arfvm;
            arf.ShowDialog();
            LoadEntities();

        }