0
我想在我的項目中實現我的樹視圖的分層數據模板。 結構應該看起來像:treeview的分層數據模板類
- ManagedItems (RootItem)
- Department 1
-Client 1
- Feature 1
- Feature 2
-Client 2
- Feature 1
- Department 2
- Department 4
- Department 5
-Client 4
- Feature 1
- Department 3
-Client 3
- Feature 1
- Feature 2
- Feature 3
//Current class for datatype
public class Entries
{
public string Department { get; set; }
public string Client { get; set; }
// ?? How to implement a drive array and a feature array which will be displayed correctly in the treeview?
public ObservableCollection<Entries> Children { get; set; }
}
這是一個在C#和WPF(.NET 4.0)。 有些想法?
謝謝。
這篇文章(http://www.codeproject.com/Articles/26288/Simplifying-the-WPF-TreeView-by-Using-the-ViewMode)是WPF TreeView在網絡上事實上最好的例子。如果你還沒有聽說過MVVM,你也可以看看它的一些例子。 – 2012-03-15 13:52:37