# .NET MAUI DropDownButton ToolbarItem

Add a button displaying a drop-down panel in the Toolbar control using the `DropDownButtonToolbarItem`.

The exposed properties are:

* `IsOpen`(`bool`)—Indicating whether the drop-down is currently open.
* `DropDownContentTemplate`(`ControlTemplate`)—Specifies the `ControlTemplate` of the drop-down content. The target type of this template is `Telerik.Maui.Controls.DropDownButtonToolbarItemViewContent.`
* `DropDownIndicatorTemplate`(`ControlTemplate`)—Specifies the `ControlTemplate` of the drop-down indicator. The target type of this template is `Telerik.Maui.Controls.DropDownButtonToolbarItemViewIndicator.`
* `Text`(`string`)—Defines the text(target type `Label`) in the toolbar item. You can display an image next to the text.
* `ImageSource`(`Microsoft.Maui.Controls.ImageSource`)—Specifies the source of the image to display in the toolbar item.

## Events

The exposed events are:

* `IsOpenChanged`—Raised when the `IsOpen` 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

* `Style` property with target type `DropDownButtonToolbarItemView`. The properties exposed in the `DropDownButtonToolbarItemView` are:

* `IsOpen`(`bool`)—Indicating whether the drop-down is currently open.

* `DropDownHorizontalOffset`(`double`)—Specifies the horizontal offset in pixels of the drop-down from the button.

* `DropDownVerticalOffset`(`double`)—Specifies the vertical offset in pixels of the drop-down from the button.

* `DropDownIndicatorSpacing`(`double`)—Specifies the spacing in pixels between the drop-down indicator and the button content.

* `IsDropDownIndicatorVisible`(`bool`)—Indicating whether the drop-down indicator is visible in the button.

* `DropDownPlacement`(enum of type `Telerik.Maui.Controls.PlacementMode`)—

* `DropDownContentStyle`(`Style` with target type `Telerik.Maui.Controls.DropDownButtonToolbarItemViewContent`)—Specifies the style for the content in the drop-down.

* `DropDownIndicatorStyle`(`Style` with target type `Telerik.Maui.Controls.DropDownButtonToolbarItemViewIndicator`)—Specifies the style for the drop-down indicator.

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), [LabelToolbarItemView](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/label#styling) and [ToolbarItemView](https://www.telerik.com/maui-ui/documentation/controls/toolbar/items/overview#styling).

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

```XAML
<Style TargetType="telerik:ButtonToolbarItemView" x:Key="buttonItemStyle">
    <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="Opened">
                    <VisualState.Setters>
                        <Setter Property="BackgroundColor" Value="#1188FF" />
                        <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>
```

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

```XAML
<Style TargetType="telerik:DropDownButtonToolbarItemViewContent" x:Key="dropDownContentStyle">
    <Setter Property="BackgroundColor" Value="#F0F7FF" />
    <Setter Property="BorderBrush" Value="#1188FF" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="CornerRadius" Value="8" />
    <Setter Property="ContentPadding" Value="4" />
</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)
* [Navigation Button 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)
