menu

WinUI

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class RibbonButton - WinUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class RibbonButton

    Represents a button which used in SfRibbon control.

    Inheritance
    System.Object
    RibbonButton
    Implements
    IRibbonElement
    IRibbonItem
    Namespace: Syncfusion.UI.Xaml.Ribbon
    Assembly: Syncfusion.Ribbon.WinUI.dll
    Syntax
    public class RibbonButton : Button, IRibbonElement, IRibbonItem
    Remarks

    The RibbonButton control displays in different ActiveSizeMode variations such as large, medium, and small, and with no images.

    Examples
    <ribbon:RibbonButton Content="Paste"
                         SizeMode="Small">
       <ribbon:RibbonButton.Icon>
           <SymbolIcon Symbol="Paste" />
       </ribbon:RibbonButton.Icon>
    </ribbon:RibbonButton>

    Constructors

    RibbonButton()

    Initializes a new instance of the RibbonButton class.

    Declaration
    public RibbonButton()

    Fields

    AllowedSizeModesProperty

    Identifies the RibbonElementSizeModes property.

    Declaration
    public static readonly DependencyProperty AllowedSizeModesProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    DisplayOptionsProperty

    Identifies the DisplayOptions property.

    Declaration
    public static readonly DependencyProperty DisplayOptionsProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    IconProperty

    Identifies the Icon dependency property.

    Declaration
    public static readonly DependencyProperty IconProperty
    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

    AllowedSizeModes

    Gets or sets the size mode options for ribbon element. Using any of these options, the ribbon element gets arranged when resizing the ribbon.

    Declaration
    public RibbonElementSizeModes AllowedSizeModes { get; set; }
    Property Value
    Type Description
    RibbonElementSizeModes

    The default value is Large | Normal | Small. Fields:

    EnumerationDescription
    SmallDisplays only the Image.
    NormalDisplays image along with the content in Horizontal arrangement.
    LargeDisplays image along with the content in Vertical arrangement.

    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:

    EnumerationDescription
    NormalThe IRibbonItem gets displayed when SfRibbon is in Normal.
    SimplifiedThe IRibbonItem gets displayed when SfRibbon is in Simplified.
    OverflowThe IRibbonItem gets displayed in overflow menu when SfRibbon is in Simplified.

    Icon

    Gets or sets the graphic content of the RibbonButton.

    Declaration
    public IconElement Icon { get; set; }
    Property Value
    Type
    Microsoft.UI.Xaml.Controls.IconElement
    Examples
    <ribbon:RibbonButton Content="Paste"
                         SizeMode="Small">
       <ribbon:RibbonButton.Icon>
           <SymbolIcon Symbol="Paste" />
       </ribbon:RibbonButton.Icon>
    </ribbon:RibbonButton>
    
    <ribbon:RibbonButton Content="Paste"
                         SizeMode="Normal">
       <ribbon:RibbonButton.Icon>
           <FontIcon FontFamily="Segoe MDL2 Assets"
                     FontSize="16"
                     Glyph="&#xED25;" />
       </ribbon:RibbonButton.Icon>
    </ribbon:RibbonButton>
    
    <ribbon:RibbonButton Content="Paste"
                         SizeMode="Large">
       <ribbon:RibbonButton.Icon>
           <BitmapIcon UriSource="ms-appx:///Assets/Paste.png" />
       </ribbon:RibbonButton.Icon>
    </ribbon:RibbonButton>

    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:RibbonButton AllowedSizeModes ="Large" >
        <ribbon:RibbonButton.Icon>
              <SymbolIcon Symbol ="Copy" />
        </ribbon:RibbonButton.Icon>
        <ribbon:RibbonButton.ScreenTip>
              <ribbon:ScreenTip Title ="Copy" Content="Copy the selection and put it on the clipboard."  />
        </ribbon:RibbonButton.ScreenTip>                          
    </ribbon:RibbonButton>

    Methods

    OnCreateAutomationPeer()

    Declaration
    protected override AutomationPeer OnCreateAutomationPeer()
    Returns
    Type
    Microsoft.UI.Xaml.Automation.Peers.AutomationPeer

    Explicit Interface Implementations

    IRibbonElement.ActiveSizeMode

    Gets or sets the current SizeMode value of ribbon item which represent the how the image and content of ribbon items get arranged.

    Declaration
    SizeMode IRibbonElement.ActiveSizeMode { get; set; }
    Returns
    Type Description
    SizeMode

    Small mode arrange the ribbon item only with image, Normal mode arrange the ribbon item with image and content in horizontal layout, where in Large mode arrange the ribbon with image and content in vertical layout. The default value is Normal.

    IRibbonItem.Clone()

    This method helps to clone the RibbonButton.

    Declaration
    FrameworkElement IRibbonItem.Clone()
    Returns
    Type
    Microsoft.UI.Xaml.FrameworkElement

    Implements

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