RibbonCommand, with some CommandParameters

Mar 19, 2009 at 1:13 PM

In the current implementation of the Ribbon control, I found no way to use a single RibbonCommand with differents LabelTitle.

I have to define and bind a specific RibbonCommand only for customize LabelTitle.
Nevertheless, the business logic is the same and depends just of the CommandParameter.

Perhaps the title, tooltip and image properties should be be available with RibbonButton instead of the underlying Command...

So, how can I do to not have to define a RibbonCommand when the business logic is the same? Only LabelTitle, and of course, CommandParameter must be changed.

Mar 19, 2009 at 1:26 PM
It's a bit of a hack, but one way to do it could be to make each RibbonCommand a simple wrapper around underlying functionality that implements the actual business logic. Then, you could effectively have multiple RibbonCommands perform the exact same action, or the same action with some variance based on how it is invoked.
Mar 19, 2009 at 2:23 PM
Thanks for you response.
But with your solution, I always have to define one CommandRibbon for each RibbonControl. That represents an unnecessary work overload and is not elegant.
What is the position of the Ribbon control developpers?
Mar 20, 2009 at 1:52 AM
Hi Cyber-Sinh,

In Ribbon V1 we're doing away with the RibbonCommand class, and as you suggest LabelTitle will be on the RibbonButton (and other controls) instead of on the Command.  This way you'll be able to assign the same command to multiple controls and give them all a unique title.  I don't believe there is a workaround for this in the CTP.