The RadRibbonToggleButton represents an extension of the RadToggleButton.
It provides an easier interaction with the RadRibbonBar 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.
Tip |
|---|
| To learn more about the RadToggleButtonButton control read its documentation. |
Here is a sample definition of a RadRibbonToggleButton:
CopyXAML
<telerik:RadRibbonToggleButton Text="Symbol"
SmallImage="/Icons/16/Symbol.png"
LargeImage="/Icons/32/Symbol.png"
Size="Large"
IsAutoSize="True"
CollapseToSmall="WhenGroupIsMedium"
CollapseToMedium="Never" />This button has its initial size set to Large and its text label set to "Symbol".
As the IsAutoSize property is set to True the button will change its size depending
on the RadRibbonGroup's size. The button will also never collapse to its Medium size
and will collapse to its Small size when the RadRibbonGroup collapses to
Medium.
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.
CopyXAML
<telerik:RadRibbonToggleButton Text="Symbol"
...
Checked="RadRibbonToggleButton_Checked"
Unchecked="RadRibbonToggleButton_Unchecked" />
CopyC#
private void RadRibbonToggleButton_Checked( object sender, RoutedEventArgs e )
{
}
private void RadRibbonToggleButton_Unchecked( object sender, RoutedEventArgs e )
{
}
CopyVB.NET
Private Sub RadRibbonToggleButton_Checked(sender As Object, e As RoutedEventArgs)
End Sub
Private Sub RadRibbonToggleButton_Unchecked(sender As Object, e As RoutedEventArgs)
End Sub
Customizing the Ribbon ToggleButton
To learn how to change the default appearance of the RibbonToggleButton read
this topic.
See Also