hi,
is it possible to have a usercontrol in a XamRibbonTabItem or XamRibbonGroup? can you please point to some sample code on this?
thanks.
Hello,
Thank you for your post. I have been investigating the functionality that you are looking for and I can suggest creating a custom tool and add it in a RibbonGroup. You can add the user control that you wish to display in the template for that custom tool. I have created a sample application for you that demonstrates how you can implement this approach.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
thank you for the quick reply and the solution works.
how does the interaction between usercontrol and xamribbon work as the user control is now in a controltemplate. is it possible to get the instance of xamribbon in the usercontrol and is it possible to get instance of usercontrol in xamribbon?
I have been looking into your reply and I have modified the sample application in order to demonstrates how you can access the UserControl through the XamRibbon and the XamRibbon through the UserControl. To do that I have added a property to the UserControlRibbonTool form type RibbonToolUserControl and initialize it. In the Template for the UserControlRibboToolControl, I have changed the UserControlRibboToolControl with a ContentControl and bound its Content to the property form type UserControlRibboToolControl that I have added to the custom tool. By doing so you can access the UserControl through the custom tool and the XamRibbon. Also I have bound the Tag property of the ContentControl that holds the RibbonToolUserControl, to the UserControlRibboToolControl’s Tool.Ribbon property and by doing so you can access the XamRibbon in the user control.
if we need to have multiple user controls in different ribbon tab items, is it possible to create a generic class that extends ribbontool type for all the user controls or do we need to create different content templates for each of the usercontrol?
thank you.
if we need to have multiple user controls in different ribbon tab items, is it possible to create a generic class that inherits ribbontool type for all the user controls or do we need to create different content templates for each of the usercontrol?
Also, in the above provided sample, on changing ribbontabitem(if there is more than one),it throws following exception
"Provide value on ‘System.Windows.Data.Binding’ threw an exception"