对于TreeView绑定一直没弄清楚,求师傅指点!
现在有这样一个List
List<PropertyNodeItem> parent = new List<PropertyNodeItem>(); List<PropertyNodeItem> I = new List<PropertyNodeItem>(); I.Add(new PropertyNodeItem() { Title = "1", Img = ChangeBitmapToImageSource((Bitmap)Bitmap.FromFile(@"G:\Images\轻量级\1.jpg ")) }); I.Add(new PropertyNodeItem() { Title = "2", Img = ChangeBitmapToImageSource((Bitmap)Bitmap.FromFile(@"G:\Images\轻量级\2.jpg ")) }); I.Add(new PropertyNodeItem() { Title = "3", Img = ChangeBitmapToImageSource((Bitmap)Bitmap.FromFile(@"G:\Images\轻量级\3.jpg ")) }); I.Add(new PropertyNodeItem() { Title = "4", Img = ChangeBitmapToImageSource((Bitmap)Bitmap.FromFile(@"G:\Images\轻量级\4.jpg ")) }); I.Add(new PropertyNodeItem() { Title = "5", Img = ChangeBitmapToImageSource((Bitmap)Bitmap.FromFile(@"G:\Images\轻量级\5.jpg ")) }); I.Add(new PropertyNodeItem() { Title = "6", Img = ChangeBitmapToImageSource((Bitmap)Bitmap.FromFile(@"G:\Images\轻量级\6.jpg ")) }); I.Add(new PropertyNodeItem() { Title = "7", Img = ChangeBitmapToImageSource((Bitmap)Bitmap.FromFile(@"G:\Images\轻量级\7.jpg ")) }); I.Add(new PropertyNodeItem() { Title = "8", Img = ChangeBitmapToImageSource((Bitmap)Bitmap.FromFile(@"G:\Images\轻量级\8.jpg ")) }); parent.Add(new PropertyNodeItem() { Title = "Parent", Item = I });
如何
如何将parent赋给TreeView啊