CommandBarFlyout.AlwaysExpanded Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that indicates whether or not the CommandBarFlyout should always stay in its Expanded state and block the user from entering the Collapsed state. Defaults to false.
This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).
public:
property bool AlwaysExpanded { bool get(); void set(bool value); };
bool AlwaysExpanded();
void AlwaysExpanded(bool value);
public bool AlwaysExpanded { get; set; }
Public Property AlwaysExpanded As Boolean
Property Value
bool
Examples
In the following example, the CommandBarFlyout will open in its expanded state and the user will not be able to send it to its collapsed state.
<CommandBarFlyout x:Key="Flyout1" AlwaysExpanded="true">
<AppBarButton Label="Share" Icon="Share" Click="OnElementClicked" />
<AppBarButton Label="Save" Icon="Save" Click="OnElementClicked" />
<CommandBarFlyout.SecondaryCommands>
<AppBarButton x:Name="ResizeButton1" Label="Resize" Click="OnElementClicked" />
<AppBarButton x:Name="MoveButton1" Label="Move" Click="OnElementClicked" />
</CommandBarFlyout.SecondaryCommands>
</CommandBarFlyout>
Remarks
When this property is set to true, the "see more" button will not appear on the CommandBarFlyout, and the user will not be able to collapse the CommandBarFlyout. While the "see more" button is not visible, other AppBarButtons/CommandBarFlyout items are able to take its space.
The CommandBarFlyout still has normal closing behavior when this property is set (when the user clicks a secondary command or clicks outside of the flyout, the flyout will close).