Class RibbonItemHost
Represents a container for any controls in a RibbonGroup.
Inheritance
Implements
Namespace: Syncfusion.UI.Xaml.Ribbon
Assembly: Syncfusion.Ribbon.WinUI.dll
Syntax
public class RibbonItemHost : Control, IRibbonItem
Remarks
The RibbonItemHost container allows any control, such as a text box, check box, or combo box, to be hosted within the RibbonGroup.
Examples
This code example demonstrates how to add a control to the RibbonItemHost container.
<ribbon:RibbonItemHost>
<ribbon:RibbonItemHost.ItemTemplate>
<ComboBox x:Name="FontComboBox"
Width="173">
<ComboBoxItem Content="Calibri" />
<ComboBoxItem Content="Arial" />
<ComboBoxItem Content="Segoe UI" />
</ComboBox>
</ribbon:RibbonItemHost.ItemTemplate>
</ribbon:RibbonItemHost>
Constructors
RibbonItemHost()
Initializes a new instance of the RibbonItemHost class.
Declaration
public RibbonItemHost()
Fields
DisplayOptionsProperty
Identifies the DisplayOptions property.
Declaration
public static readonly DependencyProperty DisplayOptionsProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
ItemTemplateProperty
Identifies the ItemTemplate dependency property.
Declaration
public static readonly DependencyProperty ItemTemplateProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
ScreenTipProperty
Identifies the ScreenTip property.
Declaration
public static readonly DependencyProperty ScreenTipProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
Properties
DisplayOptions
Gets or sets the way that the ribbon items are displayed in different LayoutModeOptions.
Declaration
public DisplayOptions DisplayOptions { get; set; }
Property Value
Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
DisplayOptions | The default value is Normal | Simplified. Fields:
|
Icon
Gets or sets the graphic content of the RibbonItemHost.
Declaration
public IconElement Icon { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.Controls.IconElement | The default value is null. |
ItemTemplate
Gets or sets a content of the RibbonItemHost, where the custom controls can be placed.
Declaration
public DataTemplate ItemTemplate { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.UI.Xaml.DataTemplate | The default value is null. |
Remarks
Controls like combo box, text box, radio button, checkbox etc. can be placed inside the ItemTemplate.
Examples
This code example shows how to add controls inside RibbonItemHost via ItemTemplate.
<ribbon:RibbonItemHost>
<ribbon:RibbonItemHost.ItemTemplate>
<ComboBox x:Name="FontComboBox"
Width="173">
<ComboBoxItem Content="Calibri" />
<ComboBoxItem Content="Arial" />
<ComboBoxItem Content="Segoe UI" />
</ComboBox>
</ribbon:RibbonItemHost.ItemTemplate>
</ribbon:RibbonItemHost>
ScreenTip
Gets or sets the ScreenTip that is used to show a pop-up window when the pointer hovers over a ribbon item to provide details about its functionality.
Declaration
public ScreenTip ScreenTip { get; set; }
Property Value
Type | Description |
---|---|
ScreenTip | The default is null. |
Examples
<ribbon:RibbonItemHost>
<ribbon:RibbonItemHost.ItemTemplate>
<DataTemplate>
<CheckBox Content = "Ruler" />
</ DataTemplate >
</ ribbon:RibbonItemHost.ItemTemplate>
<ribbon:RibbonItemHost.ScreenTip>
<ribbon:ScreenTip Title = "Ruler" Content="Show rulers next to your docoment."/>
</ribbon:RibbonItemHost.ScreenTip>
</ribbon:RibbonItemHost>
Explicit Interface Implementations
IRibbonItem.Clone()
This method is used to clone the RibbonItemHost control.
Declaration
FrameworkElement IRibbonItem.Clone()
Returns
Type |
---|
Microsoft.UI.Xaml.FrameworkElement |