Bind a SL4 TreeView to an IGrouping using Caliburn

Posted by illdev on Stack Overflow See other posts from Stack Overflow or by illdev
Published on 2010-05-04T01:59:02Z Indexed on 2010/05/04 2:08 UTC
Read the original article Hit count: 504

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...

© Stack Overflow or respective owner

Related posts about caliburn

Related posts about silverlight-4.0