Hi,
I need to create a reusable RibbonGroup. Something like UserControl. Is it a common practice to create a RibbonGroup that is added then to the RibbonTab? Can it be done only programmatically?
~Vitaly
I don't believe this would work. You wouldn't be able to add tools to the ribbon group unless the ribbon group were already in a ribbon tab that was on a toolbars manager. This is because when adding tools (either with a tool instance or with a key), the root tool must be found so the SharedProps can be properly hooked up to the new instance tool. I would recommend comming up with a different approach to add a ribbon group at runtime.
Mike, thanks for the response.
I'm interested if there is a common way to achieve this. For example I have a user control that is configurable. I want to configure it via ribbon group. I would like to develop the controlling ribbon group once and reuse it later in different applications where I use the mentioned user control.
-Vitaly
Once again I would not recommend this. I would instead recommend defining a method on the UserControl which takes a RibbonTab instance and adds a RibbonGroup to it with its own tools. So each time the UserControl is used in a new place, it would still create new RibbonGroup instances, but the code required to define that RibbonGroup would only be needed in one place.