New to Telerik UI for .NET MAUI? Start a free 30-day trial
.NET MAUI Button ToolbarItem
Updated over 6 months ago
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.XAML<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—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
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.
xaml
<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>