public static Body Load() { XmlSerializer serializer = new XmlSerializer(typeof(Body)); Body b = null; if (File.Exists("data/data.xml")) { XmlTextReader xmlReader = new XmlTextReader("data/data.xml"); b = (Body)serializer.Deserialize(xmlReader); xmlReader.Close(); } else { b = new Body(); } Groesse = b.bodyEntryFaktor.Groesse; BodyEntryFaktorStatic = b.bodyEntryFaktor; foreach (var b1 in b.bodyList.Liste) { b1.Parent = b.bodyList; b1.OnPropertyChanged("BMI"); b1.OnPropertyChanged("Punkte"); } b.bodyList.Refresh(); return b; }
public Body() { bodyList = new BodyList(); bodyEntryFaktor = new BodyEntryFaktor(); }