I know this question has been asked to death, but I have tried lots of the suggested answers I have found and the Combo Box is still not populating when I start the WPF in VS201
As for me, simpliest way is XmlSerializer
.
public class Person
{
public string personName;
public string personEmail;
public string personReports;
}
public class People
{
[XmlElement("Person")]
public List<Person> Persons;
}
Load data:
var people = (People)new XmlSerializer(typeof(People)).Deserialize(stream);
employeeNameBox.ItemsSource = people.Persons;
ComboBox code:
<ComboBox x:Name="employeeNameBox" IsReadOnly="False" HorizontalAlignment="Left" IsEditable="True" DisplayMemberPath="personName">