Back to Devexpress

ToolbarCustomItem Class

maui-devexpress-dot-maui-dot-controls-74f9da9c.md

latest12.6 KB
Original Source

ToolbarCustomItem Class

An item within a DXToolbar that serves as a container for custom objects.

Namespace : DevExpress.Maui.Controls

Assembly : DevExpress.Maui.Controls.dll

NuGet Package : DevExpress.Maui.Controls

Declaration

csharp
[DXLicenseMAUI]
public class ToolbarCustomItem :
    ToolbarContentItemBase

Remarks

Add ToolbarCustomItem to DXToolbar

The following code sample displays a ToolbarCustomItem item that contains a CheckEdit control:

xaml
<ContentPage ...
    xmlns:dxc="clr-namespace:DevExpress.Maui.Controls;assembly=DevExpress.Maui.Controls"
    xmlns:dxc="clr-namespace:DevExpress.Maui.Editors;assembly=DevExpress.Maui.Editors">
    <Grid>
        <dxc:DXToolbar>
            <!-- ... -->
            <dxc:ToolbarCustomItem>
                <dxe:CheckEdit IsChecked="True" Label="Light Theme" />
            </dxc:ToolbarCustomItem>
        </dxc:DXToolbar>
    </Grid>
</ContentPage>

Handle Loading

You can use the following inherited member to handle the ToolbarCustomItem loading:

PropertyDescription
IsLoadedGets or sets whether a DXElementBase descendant is loaded.
LoadedFires when the DXElementBase descendant is loaded.
UnloadedFires when the DXElementBase descendant is unloaded.

Customize Appearance

You can use the following properties to customize common ToolbarCustomItem appearance settings:

PropertyDescription
CornerRadiusGets or sets a ToolbarContentItemBase descendant’s corner radius. This is a bindable property.
MarginGets or sets the margin value of a ToolbarContentItemBase descendant. This is a bindable property.
PaddingGets or sets the padding of a ToolbarContentItemBase descendant. This is a bindable property.
ShowContentGets or sets whether a ToolbarContentItemBase descendant’s content is displayed. This is a bindable property.
ContentGets or sets the custom content of the toolbar button. This is a bindable property.
ContentTemplateGets or sets a template that configures the content‘s appearance. This is a bindable property.
ViewStyleGets or sets the style applied to content within a ToolbarContentItemBase descendant. This is a bindable property.
StyleGets or sets the style applied to a DXElementBase descendant. This is a bindable property.
ViewStyleGets or sets the style applied to content within a ToolbarContentItemBase descendant. This is a bindable property.

Size and Alignment

You can use the following properties to customize common ToolbarCustomItem size and alignment settings:

PropertyDescription
HeightRequestGets or sets height of a ToolbarContentItemBase descendant. This is a bindable property.
MaximumHeightRequestGets or sets maximum height of a ToolbarContentItemBase descendant. This is a bindable property.
MinimumHeightRequestGets or sets minimum height of a ToolbarContentItemBase descendant. This is a bindable property.
WidthRequestGets or sets width of a ToolbarContentItemBase descendant. This is a bindable property.
MaximumWidthRequestGets or sets maximum width of a ToolbarContentItemBase descendant. This is a bindable property.
MinimumWidthRequestGets or sets minimum width of a ToolbarContentItemBase descendant. This is a bindable property.
HorizontalOptionsGets or sets the horizontal alignment of a ToolbarContentItemBase descendant. This is a bindable property.
HorizontalContentAlignmentGets or sets the horizontal alignment of a ToolbarContentItemBase descendant’s content. This is a bindable property.
VerticalOptionsGets or sets the vertical alignment of a ToolbarContentItemBase descendant. This is a bindable property.
VerticalContentAlignmentGets or sets the vertical alignment of a ToolbarContentItemBase descendant’s content. This is a bindable property.

Background Color

You can use the BackgroundColor property to customize a ToolbarCustomItem background color.

Border

You can use the following properties to customize a ToolbarCustomItem border:

PropertyDescription
BorderColorGets or sets a ToolbarContentItemBase descendant’s border color. This is a bindable property.
BorderThicknessGets or sets a ToolbarContentItemBase descendant’s border thickness. This is a bindable property.

Icon

You can use the following properties to display and customize a ToolbarCustomItem icon:

PropertyDescription
IconGets or sets the icon that is displayed within a ToolbarContentItemBase descendant. This is a bindable property.
ShowIconGets or sets whether a ToolbarContentItemBase descendant’s icon is displayed. This is a bindable property.
IconAspectGets or sets the aspect of the icon that is displayed within a ToolbarContentItemBase descendant. This is a bindable property.
IconHeightGets or sets the icon height of a ToolbarContentItemBase descendant. This is a bindable property.
IconWidthGets or sets the icon width of a ToolbarContentItemBase descendant. This is a bindable property.
IconPlacementGets or sets the icon placement within a ToolbarContentItemBase descendant. This is a bindable property.
IconIndentGets or sets the icon indent of a ToolbarContentItemBase descendant. This is a bindable property.
IconColorizationEnabledGets or sets whether the toolbar item’s icon should change its colors in pressed and disabled states. This is a bindable property.
IconColorGets or sets the icon color of a ToolbarContentItemBase descendant. This is a bindable property.

Text and Font Settings

You can use the following properties to display and customize a ToolbarCustomItem font settings:

PropertyDescription
FontAttributesGets or sets a ToolbarContentItemBase descendant’s font attributes. This is a bindable property.
FontFamilyGets or sets a ToolbarContentItemBase descendant’s font family. This is a bindable property.
FontSizeGets or sets a ToolbarContentItemBase descendant’s font size. This is a bindable property.
FontAutoScalingEnabledGets or sets whether the toolbar item’s text is scaled according to the operating system’s text scale setting. This is a bindable property.
TextColorGets or sets the text color of a ToolbarContentItemBase descendant. This is a bindable property.
TextCharacterSpacingGets or sets the spacing between characters of a ToolbarContentItemBase descendant’s text. This is a bindable property.
TextDecorationsGets or sets text decorations applied to a ToolbarContentItemBase descendant’s text. This is a bindable property.
TextHorizontalAlignmentGets or sets the horizontal alignment applied to a ToolbarContentItemBase descendant’s text. This is a bindable property.
TextVerticalAlignmentGets or sets the vertical alignment applied to a ToolbarContentItemBase descendant’s text. This is a bindable property.
TextLineBreakModeGets or sets the line breaking mode for a ToolbarContentItemBase descendant’s text. This is a bindable property.
TextLineHeightGets or sets line height applied to a ToolbarContentItemBase descendant’s text. This is a bindable property.
TextMaxLinesGets or sets the maximum number of a ToolbarContentItemBase descendant’s text. This is a bindable property.

Implements

INotifyPropertyChanged

IElementController

Inheritance

System.Object BindableObject Element DevExpress.Maui.Core.Internal.DXElementBaseCore DXElementBase ToolbarElementBase ToolbarItemBase ToolbarContentItemBase ToolbarCustomItem ToolbarText

Extension Methods

Yield<ToolbarCustomItem>()

YieldIfNotNull<ToolbarCustomItem>()

See Also

ToolbarCustomItem Members

Items

DevExpress.Maui.Controls Namespace