menu

Class RibbonToggleButton - WinUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class RibbonToggleButton

    Represents a button that can be selected or cleared, by a user.

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

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

    Examples
    <ribbon:RibbonToggleButton Content="Paste"
                         AllowedSizeModes="Small">
       <ribbon:RibbonToggleButton.Icon>
           <SymbolIcon Symbol="Paste" />
       </ribbon:RibbonToggleButton.Icon>
    </ribbon:RibbonToggleButton>

    Constructors

    RibbonToggleButton()

    Initializes a new instance of the RibbonToggleButton class.

    Declaration
    public RibbonToggleButton()

    Fields

    AllowedSizeModesProperty

    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 static readonly DependencyProperty AllowedSizeModesProperty
    Field Value
    Type
    Microsoft.UI.Xaml.DependencyProperty

    DisplayOptionsProperty

    Gets or sets the way that the ribbon items are displayed in different LayoutModeOptions.

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

    IconProperty

    Gets or sets the graphic content of the RibbonToggleButton.

    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 RibbonToggleButton.

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

    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:RibbonToggleButton>
        <ribbon:RibbonToggleButton.Icon>
            <SymbolIcon Symbol = "Bold" />
        </ ribbon:RibbonToggleButton.Icon>
        <ribbon:RibbonToggleButton.ScreenTip>
            <ribbon:ScreenTip Content ="Make your text bold." Title="Bold"/>
        </ribbon:RibbonToggleButton.ScreenTip>
    </ribbon:RibbonToggleButton>

    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 RibbonToggleButton.

    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