.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="Filters">
<telerik:OptionsButtonToolbarItem.ImageSource>
<FontImageSource Glyph="{x:Static telerik:TelerikFont.IconFilters}"
FontFamily="{x:Static telerik:TelerikFont.Name}"
Size="16" />
</telerik:OptionsButtonToolbarItem.ImageSource>
<telerik:OptionsButtonToolbarItem.OptionsContentTemplate>
<ControlTemplate>
<VerticalStackLayout Spacing="10"
WidthRequest="200"
Padding="20">
<Label Text="Brightness" />
<Slider />
<Label Text="Contrast" />
<Slider />
<HorizontalStackLayout Spacing="10"
HorizontalOptions="End">
<Button Text="OK" />
<Button Text="Cancel" />
</HorizontalStackLayout>
</VerticalStackLayout>
</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 isTelerik.Maui.Controls.OptionsButtonToolbarItemViewContent
. -
OptionsContentTemplate
(Microsoft.Maui.Controls.ControlTemplate
)—Specifies the template of the options content. The target type of this style isTelerik.Maui.Controls.The target type of this template is Telerik.Maui.Controls.OptionsButtonToolbarItemViewContent
. -
Text
(string
)—Defines the text(target typeLabel
) 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
—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
Use the Style
property with target type OptionsButtonToolbarItemView
. The available properties 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 isTelerik.Maui.Controls.OptionsButtonToolbarItemViewContent
. -
OptionsContentTemplate
(Microsoft.Maui.Controls.ControlTemplate
)—Specifies the template of the options content. The target type of this style isTelerik.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.