.NET MAUI Entry ToolbarItem
Add input fields to the Toolbar by using the EntryToolbarItem
.
The available configuration property is:
-
Text
(string
)—Defines the text (target typeLabel
) in the toolbar item. You can display an image next to the text.
Events
The Entry Toolbar item emits the following events:
-
TextChanged
—Raised when theEntryToolbarItem.Text
property has changed. -
EntryCompleted
—Raised when the user finalizes the text in theMicrosoft.Maui.Controls.Entry
control by pressing theReturn
key.
Styling
You can style the EntryToolbarItem
by using the following property:
-
Style
—The target type of the property is theEntryToolbarItemView
control.
In addition to the Style
property that is specific to the Telerik EntryToolbarItem
, you can also use the EntryStyle
property (target type RadEntry
) and use all properties that are available for customizing and styling the RadEntry
control. Some of these properties are:
-
TextColor
(Microsoft.Maui.Graphics.Color
)—Specifies the color of the text in the toolbar item. -
Placeholder
(string
)—Specifies the text that is displayed when the control is empty. -
PlaceholderColor
(Microsoft.Maui.Graphics.Color
)—Specifies the color of the text that is displayed when the control is empty. -
FontFamily
(string
)—Specifies the font family of the text to display in the toolbar item. -
FontAutoScalingEnabled
(bool
)—Determines whether the font of the entry scales automatically according to the operating system settings. Default value is true. -
FontSize
(double
)—Specifies the font size of the text to display in the toolbar item. -
FontAttributes
(enum of typeMicrosoft.Maui.Controls.FontAttributes
)—Defines the font attributes of the text to display in the toolbar item. Default value isNone
. -
HorizontalTextAlignment
(enum of typeMicrosoft.Maui.TextAlignment
)—Defines the horizontal alignment of the text to display in the toolbar item. The default value isStart
. -
VerticalTextAlignment
(enum of typeMicrosoft.Maui.TextAlignment
)—Defines the vertical alignment of the text to display in the toolbar item. Default value isCenter
. -
HorizontalOptions
(enum of typeMicrosoft.Maui.Controls.LayoutOptions
)—Specifies the horizontal alignment options of the content displayed in the toolbar item. -
VerticalOptions
(enum of typeMicrosoft.Maui.Controls.LayoutOptions
)—Specifies the vertical alignment options of the content displayed in the toolbar item.
The following example demonstrates how to style the EntryToolbarItem
.
1. Apply the style in the resources:
<Style TargetType="telerik:RadEntry" x:Key="entryStyle">
<Setter Property="Placeholder" Value="EntryToolbar"/>
</Style>
2. Add the EntryToolbarItem
definition:
<telerik:EntryToolbarItem EntryStyle="{StaticResource entryStyle}"/>