Bind a SL4 TreeView to an IGrouping using Caliburn
- by illdev
I am just starting in the SL world and am trying to use the Caliburn NavigationShell as my starting point. I converted the solution to SL4 and use Caliburn from the trunk .
To create the basic navigation, I am a bit unsure (well, quite), how I can display the original StackPanel of Buttons as a collapsible Treeview.
I changed ITaskBarItem to own a simple GroupName property
public interface ITaskBarItem : IEntryPoint
{
BitmapImage Icon { get; }
string DisplayName { get; }
string GroupName { get;}
}
then, I expose this in ShellViewModel to the View:
public IEnumerable<IGrouping<string, ITaskBarItem>> TaskBarItems
{
get { return _taskBarItems.GroupBy(t => t.GroupName); }
}
How can I do the xaml markup so that I get a simple hierarchy?
How can I bind Actions with out the use of Buttons?
GroupName
DisplayName
DisplayName
DisplayName
GroupName
DisplayName
DisplayName
DisplayName
...
Mind, this is MVVM, so I am not going to use code behind or events to do that...