I am a university student taking a HCI design course, and using C# and WPF for the first time. I have read a little about xml, and it seems like a good way to get input for use in my program. I have an XML file i made that contains a list of houses and there peramaters, like so:
<house>
<Price>400000</price>
<neighborhood>BrentWood</neighborhood>
<description>This is a so and so house, located...</description>
</house>
<house>
<Price>300000</price>
<neighborhood>BrentWood</neighborhood>
<description>This is a so and so house, located...</description>
</house>
And i have a house class like so:
public class house{
public house(int price, string neighborhood, string description){
this.price = price;
this.neighborhood = neighborhood;
this.description = description;
}
public int price;
public string neighborhood;
public string description;
}
I have read a little about xml, but i cant seems to find a tutorial to make a function that takes the xml file as input, and returns a List of newly created house objects. Can anyone show me how this is done? Or maybe suggest a better way of defining the house objects in a file, and loading them as house objects?