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