New to Telerik UI for WinUI? Download free 30-day trial

Ribbon ToggleButton

The RadRibbonToggleButton represents an extension of the Microsoft.UI.Xaml.Controls.ToggleButton. It provides an easier interaction with the RadRibbonView control. What is special about the RadRibbonToggleButton is that it has two states: checked and unchecked. To switch between these states just click on it.

You can access the RadRibbonToggleButton control through an alias pointing to the Telerik.UI.Xaml.Controls namespace: xmlns:telerik="using:Telerik.UI.Xaml.Controls"

Example 1: Declare RibbonToggleButton

    <telerik:RadRibbonTab Header="Home"> 
        <telerik:RadRibbonGroup Header="Home group"  > 
                <ribbonView:GroupVariant Variant="Small"/> 
                <ribbonView:GroupVariant Variant="Medium"/> 
                <ribbonView:GroupVariant Variant="Large"/> 
            <telerik:RadRibbonToggleButton CollapseToSmall="WhenGroupIsSmall" 
                                    Text="Admin" > 
                    <SymbolIcon Symbol="Admin"/> 
                    <SymbolIcon Symbol="Admin"/> 
This button has its initial size set to Large and its text label set to "Admin". As the IsAutoSize property is set to True the button will change its size depending on the RadRibbonGroup's size.

Figure 1: RadRibbonToggleButton Example

WinUI RadRibbonView RadRibbonToggleButton Example

Handling Changes in the the Button's Checked State

Besides the Click event, the RadRibbonToggleButton control exposes two additional events - Checked and Unchecked. They are meant to notify for changes in the checked state of the toggle button.

Example 2: Subscribe to Checked/UnChecked event of the RibbonToggleButton

<telerik:RadRibbonToggleButton Checked="RadRibbonToggleButton_Checked" 

Example 3: Checked/UnChecked event handler

private void RadRibbonToggleButton_Checked(object sender, RoutedEventArgs e) 
private void RadRibbonToggleButton_Unchecked(object sender, RoutedEventArgs e) 

See Also

In this article
Not finding the help you need?