Hi.
I'm learning to use menu tool. I'd like the menu to hold values given by an enum and use them as a parameter for a command. Is that possible?
Thanks,
Izhar Lotem
The MenuTool is just an ItemsControl that displays its items within a popup. So if you want to populate it with values from an enum you can either programatically create the menu items or you could do something like bind the ItemsSource to a collection of items that contains the enum members. I'm not sure what you mean about using them as a parameter for a command but if you mean that they'd all be used to execute the same command but use the enum value itself as the parameter you could create an itemcontainerstyle and bind the commandparameter. e.g.
Thanks!!
This was the exact example I needed. My only problem now is that the menu button turns very large and I'd like it to have the appearance same as the Select command Under Home-Editing in Office 2007: Single line, small image and then some text.
How can I make that possible.
You would use the RibbonGroup.MaximumSize attached property and set it to ImageAndTextNormal for your MenuTool.
It worked.
Thank you very much.