MVVM with Tabs and Groups

Ribbon for WPF Forum

Posted 14 years ago by Nate Hekman
Version: 9.2.0511
I am trying to use DataTemplates to bind a tab's Groups to a collection of ViewModels. For example, I was expecting the tab would have a "Groups" or "Items" collection which could be bound to my ITabViewModel.GroupViewModels, and based on the object type of each GroupViewModel (a ClipboardGroupVM, FontGroupVM, etc), WPF would use the appropriate DataTemplate which contains a Ribbon.Controls.Group.


Similarly I would like to bind the Ribbon.Tabs collection with a collection of ViewModels which (through DataTemplates) will turn into Ribbon.Controls.Tabs. The hope would be xaml something like this:

<ribbon:Ribbon Tabs="{Binding Path=TabVMs}" />
where TabVMs is a collection of ViewModels like HomeTabVM, InsertTabVM, and so on.

But Tabs is apparently not a DependencyProperty and so can't be bound.

Is there some other mechanism for generating ribbon tabs and/or groups dynamically using MVVM?

[Modified at 03/22/2010 12:52 PM]

Comments (4)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Nate,

Unfortunately we don't support that at the moment. This is something we've marked down to look into in the future, possibly at a time if we port the control to Silverlight. I'll log your request with our TODO list for Ribbon.

You could possibly work around it for now by having some sort of intermidiary class that watches for your view model changes and then updates our control collections appropriately.

Actipro Software Support

Posted 11 years ago by Chris Ray

It's been 3 years since this post. I want the exact functionality the original poster described. Has this been implemented yet?

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Chris,

No, I'm sorry, we haven't rearchitected Ribbon to support that.

Actipro Software Support

Posted 11 years ago by Kevin Carroll - Sr. Vice President, Sign Management Consultants, Inc.

I have also had to get "too creative", when simply binding a RibbonGroup template to a view model collection would be so easy.  Please look into providing better MVVM support to the Ribbon as you have the Docking Windows.

The latest build of this product (v24.1.2) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.