Answer the question
In order to leave comments, you need to log in
Genealogical tree in C#?
Hello!
There is an idea to write software for building, displaying and printing a family tree.
I am learning C# and would like to implement all this on it. Using WPF, of course :)
Everything is fine, but I still don't know where to start. That is, I have an idea that each object should contain something like List parents and List children, and so on. But I don’t know how, let’s say, “canonical” to implement this.
I am currently studying the sources of the program Family.Show. But I would still like advice on how to start implementing such a program.
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
You make the class Person{string Name, string FirstSurname, string SecondSurname, List parents, List wifes\husbunds, List children}.
Name, surname before the wedding, surname after (by the way, there can be many weddings, you can make a list of surnames), a list of parents (children can live in an orphanage, with foster children, with homosexuals, or they can be conceived by midi-chlorians), a list of wives / husbands, a list children. All.
When adding child B to person A, you check whether B has person A in the list of parents. If not, you add. When adding person A to wife B, you check if B has person A in the list of husbands / wives. If not, you add. Etc. for each connection (both ways).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question