public class DataList1Page : Page { protected DataList peopleDataList;
protected string GetColorName(Color c) { return TypeDescriptor.GetConverter(typeof(Color)).Convert ToString(c); }
private void LoadPeopleList() { // 创建数据源 Person[] people = new Person[] { new Person("Nikhil Kothari", Color.Green), new Person("Steve Millet", Color.Purple), new Person("Chris Anderson", Color.Blue), new Person("Mike Pope", Color.Orange), new Person("Anthony Moore", Color.Yellow), new Person("Jon Jung", Color.MediumAquamarine), new Person("Susan Warren", Color.SlateBlue), new Person("Izzy Gryko", Color.Red) };