.NET MAUI ToggleButton Events
The .NET MAUI ToggleButton emits a set of events that allow you to configure the component's behavior in response to specific user actions.
The .NET MAUI ToggleButton exposes the following events:
-
IsToggledChanged—Occurs when theRadToggleButton.IsToggledproperty is changed. TheIsToggledChangedevent handler receives two parameters:- The
senderwhich is of typeTelerik.Maui.Controls.RadToggleButton. ValueChangedEventArgswhich provides the following properties:NewValue(TValue)—Gets the new value from theIsToggledproperty.PreviousValue(TValue)—Gets the previous value of theIsToggledproperty.
- The
-
Clicked—Raised when theRadToggleButtonis clicked. TheClickedevent handler receives two parameters:- The
senderargument which is of typeRadToggleButton. - An
EventArgsobject which provides information about theClickedevent.
- The
-
Pressed—Raised whenRadToggleButtonis pressed (a finger presses on the buton, or a mouse button is pressed with a pointer positioned over the button). ThePressedevent handler receives two parameters:- The
senderargument which is of typeRadToggleButton. - An
EventHandlerobject which provides information on thePressedevent.
- The
-
Released—Raised when theRadToggleButtonis released (the finger or mouse button is released). TheReleasedevent handler receives two parameters:- The
senderargument which is of typeRadToggleButton. - An
EventHandlerobject which provides information on theReleasedevent.
- The
Using the IsToggledChanged Event
The following example demonstrates how to use the IsToggledChanged event:
1. Define the button in XAML:
<telerik:RadToggleButton x:Name="toggleButton"
Content="My ToggleButton Content"
IsToggledChanged="ToggleButtonIsToggledChanged"
HorizontalOptions="Center" />
<Label x:Name="label"
Text="{Binding IsToggled, Source={x:Reference toggleButton}, StringFormat='IsToggled: {0}'}"
HorizontalOptions="Center" />
2. Add the telerik namespace:
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
3. Add the IsToggledChanged event:
private void ToggleButtonIsToggledChanged(object sender, Telerik.Maui.Controls.ValueChangedEventArgs<bool?> e)
{
this.label.Text = "IsToggled: " + e.NewValue;
}
This is the result on Android:

For a runnable example demonstrating the ToggleButton
IsToggledChangedevent, see the SDKBrowser Demo Application and go to the ToggleButton > Events category.
Using the Clicked Event
The following example demonstrates how to use the Clicked event:
1. Define the button in XAML:
<telerik:RadToggleButton Content="My ToggleButton"
Clicked="OnRadToggleButtonClicked" />
<Label x:Name="label" Text="ToggleButton is clicked 0 times" />
2. Add the telerik namespace:
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
3. Add the Clicked event:
private void OnRadToggleButtonClicked(object sender, System.EventArgs e)
{
count++;
if (count == 1)
{
this.label.Text = $"ToggleButton is clicked {count} time";
}
else
{
this.label.Text = $"ToggleButton is clicked {count} times";
}
}
This is the result on Android:

For a runnable example demonstrating the ToggleButton
Clickedevent, see the SDKBrowser Demo Application and go to the ToggleButton > Events category.
Using the Pressed Event
The following example demonstrates how to use the Pressed event:
1. Define the button in XAML:
<telerik:RadToggleButton Content="My ToggleButton"
Pressed="OnToggleButtonPressed" />
<Label x:Name="label" Text="ToggleButton is pressed 0 times" />
2. Add the telerik namespace:
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
3. Add the Pressed event:
private void OnToggleButtonPressed(object sender, System.EventArgs e)
{
count++;
if (count == 1)
{
this.label.Text = $"ToggleButton is pressed {count} time";
}
else
{
this.label.Text = $"ToggleButton is pressed {count} times";
}
}
This is the result on Android:

For a runnable example demonstrating the ToggleButton
Pressedevent, see the SDKBrowser Demo Application and go to the ToggleButton > Events category.
Using the Released Event
The following example demonstrates how to use the Released event:
1. Define the button in XAML:
<telerik:RadToggleButton Content="My ToggleButton"
Released="OnToggleButtonReleased" />
<Label x:Name="label" Text="ToggleButton is pressed 0 times" />
2. Add the telerik namespace:
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
3. Add the Released event:
private void OnToggleButtonReleased(object sender, System.EventArgs e)
{
count++;
if (count == 1)
{
this.label.Text = $"ToggleButton is released {count} time";
}
else
{
this.label.Text = $"ToggleButton is released {count} times";
}
}
This is the result on Android:

For a runnable example demonstrating the ToggleButton
Releasedevent, see the SDKBrowser Demo Application and go to the ToggleButton > Events category.