.NET MAUI Button ToolbarItem
Add buttons in the toolbar using the ButtonToolbarItem
.
The available properties for configuration are:
-
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.
<telerik:ButtonToolbarItem Text="Undo">
<telerik:ButtonToolbarItem.ImageSource>
<FontImageSource Glyph="{x:Static telerik:TelerikFont.IconUndo}"
FontFamily="{x:Static telerik:TelerikFont.Name}"
Size="16" />
</telerik:ButtonToolbarItem.ImageSource>
</telerik:ButtonToolbarItem>
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
ButtonToolbarItem has a Style
property with target type ButtonToolbarItemView
. The properties exposed in the ButtonToolbarItemView
are Command
, CommandParameter
, Clicked
event.
All other properties that can be applied through style are the properties applicable for ToolbarItemView and LabelToolbarItemView.
<Style x:Key="buttonToolbarStyle" TargetType="telerik:ButtonToolbarItemView">
<Setter Property="DisplayOptions" Value="Text"/>
<Setter Property="TextColor" Value="Black"/>
<Setter Property="CornerRadius" Value="5"/>
<Setter Property="BackgroundColor" Value="LightGray"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderColor" Value="Black"/>
</Style>