我试图TreeView绑定我的集合,以便所有组显示嵌套组,每个组将显示条目.
我如何使用HierarchicalDataTemplate它TreeView来处理子组和条目集合?
组显示子组和条目:
Example:
Group1
--Entry
--Entry
Group2
--Group4
----Group1
------Entry
------Entry
----Entry
----Entry
--Entry
--Entry
Group3
--Entry
--Entry
Run Code Online (Sandbox Code Playgroud)
namespace TaskManager.Domain
{
public class Entry
{
public int Key { get; set; }
public string Name { get; set; }
}
}
namespace TaskManager.Domain
{
public class Group
{
public int Key { get; set; }
public string Name { get; set; }
public IList<Group> SubGroups { get; set; }
public IList<Entry> Entries …Run Code Online (Sandbox Code Playgroud)