View Mode Toggle Button functionality with Ribbon

Oct 5, 2009 at 8:26 PM

I am struggling with a seemingly common scenario.  I am trying to institute something like the Workbook Views ribbon group in Excel, where there is a Mode that you are switching between by using a group of toggle buttons.

In this way, you check one togglebutton, and the rest of the buttons uncheck. 

To set this up, I would like to bind to an enum property in the business object.  For instance:

enum ViewMode

{Normal = 0, PageLayout = 1, PageBreakPreview = 2}

I set this up as a 2 way binding, because the business object can be changed by routes other than the user clicking on the ribbon buttons.  Meaning, that I want the UI to update when the mode in the business object is changed.

If you've tried to setup this kind of scenario, it quickly get's out of control.  And you realize that the CORRECT way to set this up is through a WPF Selector like Listbox or ComboBox.  But in the case of the ribbon, if I use a Listbox, I will lose the auto-formatting done by the RibbonGroups as I resize the window, right?

My question is:  Can this be accomplished using a listbox in the ribbon?

If not:  Please consider a feature request for a togglebutton selector group.  This 'mode' type functionality seems like it will be a common scenario amongst many apps.