【发布时间】:2011-07-22 12:55:18
【问题描述】:
我有一个这样的类(描述 C# 中的类及其字段、方法等):
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; }
....
}
返回的 CSharppType 集合:
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
xaml 应该是什么样子?感谢您的帮助
【问题讨论】:
-
您查看过msdn.microsoft.com/en-us/library/… 的示例 XAML 吗?
-
是的。那是我的 TreeView: