WPF的TreeView控件如何绑定XML?没人回复。。郁闷! 悲剧了。。。。 板凳 lz fashion 俺没搞过wpf 汗! 等待ing... 不知道…… 还在等待ing... 继续等待ing。。。 我有点绝望了。。。。 public void FillTree() { List <Category> categories = new List <Category>(); XDocument categoriesXML = XDocument.Load("place.xml"); categories = this.GetCategories(categoriesXML.Element("Employees")); this.tree.ItemsSource = categories; }
private List <Category> GetCategories(XElement element) { return (from category in element.Elements("Node") select new Category() { Value = category.Attribute("placeID").Value,