WPF

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class RibbonItemHost

    Show / Hide Table of Contents

    Class RibbonItemHost

    Represent a ribbon item host class which allows to host any control such as text box, combo box, check box inside RibbonBar. It provides support for adding this RibbonItemHost to the QAT area. It also provides support to configure this RibbonItemHost in the QAT customization window to design the ribbon items.

    Inheritance
    System.Object
    RibbonItemHost
    Namespace: Syncfusion.Windows.Tools.Controls
    Assembly: Syncfusion.Tools.Wpf.dll
    Syntax
    public class RibbonItemHost : Control
    Remarks

    The preferable option is to add single container/control inside the RibbonItemHost.

    Examples

    This code example shows how to add controls inside RibbonItemHost via .

    <ribbon:Ribbon>
       <ribbon:RibbonTab>
          <ribbon:RibbonBar>
             <ribbon:RibbonItemHost>
                <ribbon:RibbonItemHost.ContentTemplate>
                   <DataTemplate> 
                    <ComboBox x:Name="FontComboBox"
                              Width="173">
                         <ComboBoxItem Content="Calibri" />
                         <ComboBoxItem Content="Arial" />
                         <ComboBoxItem Content="Segoe UI" />
                    </ComboBox>
                    </DataTemplate>
                </ribbon:RibbonItemHost.ContentTemplate>
             </ribbon:RibbonItemHost>
           </ribbon:RibbonBar>
       </ribbon:RibbonTab>
    </ribbon:Ribbon>

    Constructors

    RibbonItemHost()

    Declaration
    public RibbonItemHost()

    Fields

    ContentTemplateProperty

    Identifies the ContentTemplate dependency property.

    Declaration
    public static readonly DependencyProperty ContentTemplateProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty
    Remarks

    The identifier for the ContentTemplate dependency property.

    IconTemplateProperty

    Identifies the IconTemplate dependency property.

    Declaration
    public static readonly DependencyProperty IconTemplateProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty
    Remarks

    The identifier for the IconTemplate dependency property.

    LabelProperty

    Identifies the Label dependency property.

    Declaration
    public static readonly DependencyProperty LabelProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty
    Remarks

    The identifier for the Label dependency property.

    Properties

    ContentTemplate

    Gets or sets the template that used to display the content of the RibbonItemHost.

    Declaration
    public DataTemplate ContentTemplate { get; set; }
    Property Value
    Type Description
    System.Windows.DataTemplate

    The System.Windows.DataTemplate that is used to display an content of the RibbonItemHost.

    Remarks

    ContentTemplate inherits its parent DataContext.

    Examples

    This code example shows how to add controls inside RibbonItemHost via .

    <ribbon:Ribbon>
       <ribbon:RibbonTab>
          <ribbon:RibbonBar>
             <ribbon:RibbonItemHost>
                <ribbon:RibbonItemHost.ContentTemplate>
                   <DataTemplate> 
                    <ComboBox x:Name="FontComboBox"
                              Width="173">
                         <ComboBoxItem Content="Calibri" />
                         <ComboBoxItem Content="Arial" />
                         <ComboBoxItem Content="Segoe UI" />
                    </ComboBox>
                    </DataTemplate>
                </ribbon:RibbonItemHost.ContentTemplate>
             </ribbon:RibbonItemHost>
           </ribbon:RibbonBar>
       </ribbon:RibbonTab>
    </ribbon:Ribbon>

    IconTemplate

    Gets or sets the template that used to display the icon of RibbonItemHost inside the QAT customization dialog.

    Declaration
    public DataTemplate IconTemplate { get; set; }
    Property Value
    Type Description
    System.Windows.DataTemplate

    The System.Windows.DataTemplate that is used to display an icon in RibbonItemHost inside the QAT customization dialog.

    Remarks

    IconTemplate inherits its parent DataContext. When icon template is defined, RibbonItemHost loads icon using template inside the QAT customization dialog alone.

    Label

    Gets or sets the string that used to display the text of RibbonItemHost inside the QAT customization dialog.

    Declaration
    public string Label { get; set; }
    Property Value
    Type Description
    System.String

    The string value that is used to display the text of RibbonItemHost inside the QAT customization dialog.

    Examples

    This code example shows how to update text to be displayed in QAT customization for RibbonItemHost content.

    <ribbon:Ribbon>
       <ribbon:RibbonTab>
          <ribbon:RibbonBar>
             <ribbon:RibbonItemHost Label="FontList">
                <ribbon:RibbonItemHost.Content>
                    <ComboBox x:Name="FontComboBox"
                              Width="173">
                         <ComboBoxItem Content="Calibri" />
                         <ComboBoxItem Content="Arial" />
                         <ComboBoxItem Content="Segoe UI" />
                    </ComboBox>
                </ribbon:RibbonItemHost.Content>
             </ribbon:RibbonItemHost>
           </ribbon:RibbonBar>
       </ribbon:RibbonTab>
    </ribbon:Ribbon>

    Methods

    OnMouseRightButtonUp(MouseButtonEventArgs)

    Invoked when an unhandled System.Windows.UIElement.MouseRightButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

    Declaration
    protected override void OnMouseRightButtonUp(MouseButtonEventArgs e)
    Parameters
    Type Name Description
    System.Windows.Input.MouseButtonEventArgs e

    The System.Windows.Input.MouseButtonEventArgs that contains the event data. The event data reports that the right mouse button was released.

    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved