Skip to main content Link Search Menu Expand Document (external link)

CommandBar

Namespace: FluentAvalonia.UI.Controls

Represents a specialized command bar that provides layout for CommandBarButton and related command elements.

C#

public class CommandBar : ContentControl


Xaml

<ui:CommandBar />


Required Template Parts

Name Control Type
PrimaryItemsControl ItemsControl
ContentControl ContentControl
SecondaryItemsControl CommandBarOverflowPresenter
MoreButton Button


Pseudoclasses

:dynamicoverflow, :compact, :minimal, :hidden, :labelbottom, :labelright, :labelcollapsed, :primaryOnly, :secondaryOnly, :open, :disabled, :focus, :focus-visible, :focus-within, :pointerover



Examples and Usage Notes

None yet.


API

Note: Inherited members are not shown


Properties

ClosedDisplayMode Gets or sets a value that indicates whether icon buttons are displayed when the command bar is not completely open.
ClosedDisplayModeProperty Defines the `FluentAvalonia.UI.Controls.CommandBar.ClosedDisplayMode` property
DefaultLabelPosition Gets or sets a value that indicates the placement and visibility of the labels on the command bar's buttons.
DefaultLabelPositionProperty Defines the `FluentAvalonia.UI.Controls.CommandBar.DefaultLabelPosition` property
IsDynamicOverflowEnabled Gets or sets a value that indicates whether primary commands automatically move to the overflow menu when space is limited.
IsDynamicOverflowEnabledProperty Defines the `FluentAvalonia.UI.Controls.CommandBar.IsDynamicOverflowEnabled`
IsOpen Gets or sets a value that indicates whether the CommandBar is open.
IsOpenProperty Define the `FluentAvalonia.UI.Controls.CommandBar.IsOpen` property
IsSticky Gets or sets a value that indicates whether the CommandBar does not close on light dismiss.
IsStickyProperty Defines the `FluentAvalonia.UI.Controls.CommandBar.IsSticky` property
ItemsAlignment Gets or sets how the `FluentAvalonia.UI.Controls.CommandBar.PrimaryCommands` align in the CommandBar
ItemsAlignmentProperty Defines the `FluentAvalonia.UI.Controls.CommandBar.ItemsAlignment` property
OverflowButtonVisibility Gets or sets a value that indicates when a command bar's overflow button is shown.
OverflowButtonVisibilityProperty Defines the `FluentAvalonia.UI.Controls.CommandBar.OverflowButtonVisibility` property
PrimaryCommands Gets the collection of primary command elements for the CommandBar.
PrimaryCommandsProperty Defines the `FluentAvalonia.UI.Controls.CommandBar.PrimaryCommands` property
SecondaryCommands Gets the collection of secondary command elements for the CommandBar.
SecondaryCommandsProperty Defines the `FluentAvalonia.UI.Controls.CommandBar.SecondaryCommands` property


Events

Closed Occurs when the CommandBar changes from visible to hidden.
Closing Occurs when the CommandBar starts to change from visible to hidden.
Opened Occurs when the CommandBar changes from hidden to visible.
Opening Occurs when the CommandBar starts to change from hidden to visible.


Methods


CommandBarClosedDisplayMode

Compact Icon buttons are displayed but labels are not visible.
Minimal Only the ellipsis is displayed. Neither icon buttons nor labels are visible.
Hidden The app bar is not displayed.


CommandBarOverflowButtonVisibility

Auto The overflow button automatically hides when there are no secondary commands and the closed state of the CommandBar is the same as the open state.
Visible The overflow button is always shown.
Collapsed The overflow button is never shown.


CommandBarItemsAlignment

Left The items are left-aligned on the CommandBar
Right The items are right-aligned on the CommandBar


CommandBarDefaultLabelPosition

Bottom App bar button labels are shown below the icon. Labels are visible only when the command bar is open.
Right App bar button labels are shown to the right of the icon. Labels are visible even when the command bar is closed.
Collapsed App bar button labels are always hidden whether the command bar is open or closed.


ICommandBarElement

DynamicOverflowOrder Gets or sets a value that indicates the order in which a primary command in a CommandBar should be moved to the overflow menu when there is not enough room to display all primary commands.
IsCompact Gets or sets a value that indicates whether the element is shown with no label and reduced padding.
IsInOverflow Gets a value that indicates whether the CommandBar command is currently located in the overflow menu.