c# - WPF returning a List to the class -
new wpf , c# vb web forms, sorry poorly structured question add needed improve. trying implement example adding database calls mysql populate on-demand tree view control. here link sample code... sample code got db connection working , data populating dataset. iterate place in list. can not seem figure out issue passing list class populate control... public class level1 { public level1(string level1name) { this.level1name = level1name; } public string level1name { get; private set; } readonly list<level2> _level2s = new list<level2>(); public list<level2> level2s { { return _level2s; } } } i have database class queries db , parses data.... list<string> level1s = new list<string>(); dataset ds = new dataset(); foreach (datatable table in ds.tables) { foreach (datarow row in table.rows) { level1s.add((string)row["name"]); } } **update**: trying return list... re...