Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1105
ButtonTool customized
posted

Hi,

I have an Infragistics Ribbon with few tools.

I would like to add X button on the right side of the menu item.

how can I customize the  Infragistics.Windows.Ribbon.ButtonTool to include this custom control, instead of the text+image default behavior?

Thanks!

Parents
  • 6365
    Verified Answer
    Offline posted

    Hello eligazit,

    In order to customize the ButtonTool control, I can suggest you a couple of approaches:

    • Create a custom tool by implementing the IRibbonTool interface (you can extend the functionality of the ButtonTool as well). For more detailed information in regards to this approach, you can take a look at the sample implementation of a custom tool in the “xamRibbon > Display > Custom Tools” sample from our WPF Samples Browser.

    • Retemplate the ButtonTool itself, which will require using default style of the control in order to keep the built-in functionality. The default styles should be located in a "Default Styles" folder of your installed product.
      In order to create an extra custom control (the "X" button you have referred to), you can set the Template property of the ButtonTool by modifying the default template from the default style of the tool.

    I have attached a sample application that uses the second approach from above. Please refer to the "NEW RibbonButtonChrome" and the "CUSTOM BUTTON" commented tags in the "RibbonButtonToolTemplate" ControlTemplate from the Application.Resources.

    This can serve to you as a starting point for implementing the desired functionality.

    If you have any further questions, please let me know.

    XamRibbon_sample.zip
Reply Children
No Data