New to Telerik UI for .NET MAUI? Start a free 30-day trial

.NET MAUI OptionsButton ToolbarItem

Use the OptionsButtonToolbarItem for displaying an options panel in the Toolbar control. The toolbar item has to be attached to the RadToolbarOptionsPanel.

<telerik:OptionsButtonToolbarItem Text="Additions search"
                                  OptionsPanel="{x:Reference topPanel}">
    <telerik:OptionsButtonToolbarItem.Style>
        <Style TargetType="telerik:OptionsButtonToolbarItemView">
            <Setter Property="DisplayOptions" Value="Image, Text" />
            <Setter Property="ImagePosition" Value="Left" />
        </Style>
    </telerik:OptionsButtonToolbarItem.Style>
    <telerik:OptionsButtonToolbarItem.ImageSource>
        <FontImageSource Glyph="{x:Static telerik:TelerikFont.IconSearch}"
                         FontFamily="{x:Static telerik:TelerikFont.Name}"
                         Size="16" />
    </telerik:OptionsButtonToolbarItem.ImageSource>
    <telerik:OptionsButtonToolbarItem.OptionsContentTemplate>
        <ControlTemplate>
            <Grid ColumnDefinitions="Auto, *, Auto, Auto"
                  ColumnSpacing="10">
                <Label Grid.Column="0"
                       Text="Search"
                       VerticalOptions="Center" />
                <Entry Grid.Column="1"
                       Placeholder="Search for" />
                <Button Grid.Column="2"
                        Text="Next" />
                <Button Grid.Column="3"
                        Text="Back" />
            </Grid>
        </ControlTemplate>
    </telerik:OptionsButtonToolbarItem.OptionsContentTemplate>
</telerik:OptionsButtonToolbarItem>

And the RadToolbarOptionsPanel definition:

<telerik:RadToolbarOptionsPanel x:Name="topPanel" />
  • OptionsPanel(Telerik.Maui.controls.RadToolbarOptionsPanel)—Specifies the options panel associated with this toolbar item.
  • OptionsContentStyle(Telerik.Maui.controls.RadToolbarOptionsPanel)—Specifies the style of the options content. The target type of this style is Telerik.Maui.Controls.OptionsButtonToolbarItemViewContent.
  • OptionsContentTemplate(Microsoft.Maui.Controls.ControlTemplate)—Specifies the template of the options content. The target type of this style is Telerik.Maui.Controls.The target type of this template is Telerik.Maui.Controls.OptionsButtonToolbarItemViewContent.
  • 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.

Use the properties available in the DropDownButtonToolbarItem as the OptionsButtonToolbarItem inherits from it.

Events

The exposed events are:

  • Clicked&mdash:Raised when the button is clicked.

Commands

The available commands are:

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

Styling

Use the Style property with target type OptionsButtonToolbarItemView. The available proeprties that can be applied through Style are:

  • OptionsPanel(Telerik.Maui.controls.RadToolbarOptionsPanel)—Specifies the options panel associated with this toolbar item.
  • OptionsContentStyle(Telerik.Maui.controls.RadToolbarOptionsPanel)—Specifies the style of the options content. The target type of this style is Telerik.Maui.Controls.OptionsButtonToolbarItemViewContent.
  • OptionsContentTemplate(Microsoft.Maui.Controls.ControlTemplate)—Specifies the template of the options content. The target type of this style is Telerik.Maui.Controls.The target type of this template is Telerik.Maui.Controls.OptionsButtonToolbarItemViewContent.

The other available properties are the properties used in the DropDownButtonToolbarItemView, ButtonToolbarItemView, ToolbarItemView and LabelToolbarItemView.

See Also

In this article
Not finding the help you need?