Windows Dev Center

CommandBar.PrimaryCommands property

Gets the collection of primary command elements for the CommandBar.

Syntax


public IObservableVector<ICommandBarElement> PrimaryCommands { get; }


<CommandBar>
    <CommandBar.PrimaryCommands>
      commandBarElements
    </CommandBar.PrimaryCommands>
</CommandBar>

XAML Values

commandBarElements

One or more object elements for classes that implement ICommandBarElement. These are typically AppBarButton, AppBarToggleButton or AppBarSeparator elements.

Property value

Type: IObservableVector<ICommandBarElement>

The collection of primary command elements for the CommandBar. The default is an empty collection.

Remarks

The PrimaryCommands collection can contain only AppBarButton, AppBarToggleButton, or AppBarSeparator command elements. The primary commands are shown on the right side of the CommandBar, to the left of the More button (...) when the FlowDirection is LeftToRight. The layout is reversed when the FlowDirection is RightToLeft.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

CommandBar
SecondaryCommands

 

 

Show:
© 2015 Microsoft