# .NET MAUI ToggleButton ToolbarItem

Add a toggle button in the Toolbar control using the `ToggleButtonToolbarItem`.

The exposed properties are:

* `IsSelected`(`bool`)—Indicating whether the button is selected.

## Events

The exposed events are:

* `IsSelectedChanged`—Raised when the `IsSelected` property has changed.
* `Clicked`—Raised when the button is clicked.

## Commands

The available commands are:

* `Command`(`ICommand`)—Specifies the command to execute when the button is clicked.
* `CommandParameter`(`object`)—Specifies the parameter of the command, which is executed when the button is clicked.

## Styling

`ToggleButtonToolbarItem` has a `Style` property with target type `ToggleButtonToolbarItemView`. The property exposed in the `ToggleButtonToolbarItemView` is the `IsSelected` property.

All other properties that can be applied through style are the properties applicable for [ButtonToolbarItemView](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/button#styling), [ToolbarItemView](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/overview#styling) and [LabelToolbarItemView](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/label#styling)

> caption Here is an example of how to style the `ToggleButtonToolbarItem` and setting the visual states:

```XAML
<Style TargetType="telerik:SelectableButtonToolbarItemView" x:Key="selectableItemStyle">
    <Setter Property="CornerRadius" Value="4" />
    <Setter Property="VisualStateManager.VisualStateGroups">
        <VisualStateGroupList>
            <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal">
                    <VisualState.Setters>
                        <Setter Property="BackgroundColor" Value="Transparent" />
                        <Setter Property="TextColor" Value="#1188FF" />
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="PointerOver">
                    <VisualState.Setters>
                        <Setter Property="BackgroundColor" Value="#E6F2FF" />
                        <Setter Property="TextColor" Value="#0A5CBF" />
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="Selected">
                    <VisualState.Setters>
                        <Setter Property="BackgroundColor" Value="#1188FF" />
                        <Setter Property="TextColor" Value="White" />
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="SelectedDisabled">
                    <VisualState.Setters>
                        <Setter Property="BackgroundColor" Value="#9FC8F0" />
                        <Setter Property="TextColor" Value="White" />
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="Disabled">
                    <VisualState.Setters>
                        <Setter Property="BackgroundColor" Value="Transparent" />
                        <Setter Property="TextColor" Value="#B0B0B0" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateGroupList>
    </Setter>
</Style>
```

## See Also

* [SplitButton ToolbarItem](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/split-button)
* [Label ToolbarItem](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/label)
* [NavigationButton ToolbarItem](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/navigation-button)
* [ListPicker ToolbarItem](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/listpicker-button)
* [Group ToolbarItem](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/group)
* [RadioButton ToolbarItem](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/radio-button)
* [Slider ToolbarItem](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/slider)
