4
我有这样一个类(介绍C#类及其字段,方法等):WPF XAML - TreeView的分层数据模板 - 多个项目源
public class CSharpType
{
public string Name { get; private set; }
public List<CSharpMethod> Methods { get; private set; }
public List<CSharpField> Fields { get; private set; }
public List<CSharpProperty> Properties { get; private set; }
....
}
CShartpType的集合中的返回:
public List<CSharpType> TypeCollection
{
get
{
TypeCollection kolekcjaTypow = metricsCollection.Types;
Dictionary<string, CSharpType> typy = kolekcjaTypow.TypeDictionary;
var result = typy.Values.ToList();
return result;
}
}
各个领域,方法,属性有一个 “名称” 属性 ,我想有TreeView控件(如):
Person
+ Fields
+ field1 name from Fields collection
+ field2 name from Fields collection
...
+ Methods
....
+ Properties
sholud xaml看起来像什么样子?感谢您的帮助
有你看了样品XAML在http://msdn.microsoft.com/en-us/library/system.windows.hierarchicaldatatemplate.aspx ? – 2011-03-24 22:57:27
是的。这是我的TreeView: –
BeginnerWpf
2011-03-24 23:09:33