AppBarSeparator AppBarSeparator AppBarSeparator AppBarSeparator Class

Definition

Represents a line that separates items in an AppBar or CommandBar.

public : class AppBarSeparator : Control, IAppBarSeparator, ICommandBarElement, ICommandBarElement2public class AppBarSeparator : Control, IAppBarSeparator, ICommandBarElement, ICommandBarElement2Public Class AppBarSeparator Inherits Control Implements IAppBarSeparator, ICommandBarElement, ICommandBarElement2// This API is not available in Javascript.
<AppBarSeparator .../>
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited properties

Inherited events

Inherited methods

Remarks

Control style and template

You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about modifying a control's style and template, see Styling controls. The default style, template, and resources that define the look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might have different values.

Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml includes resources that you can use to modify the colors of a control in different visual states without modifying the control template. In apps that target this software development kit (SDK) or later, modifying these resources is preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling section of the Styling controls article.

This table shows the resources used by the AppBarSeparator control.

Resource keyDescription
AppBarSeparatorForegroundForeground color at rest

Constructors

AppBarSeparator() AppBarSeparator() AppBarSeparator() AppBarSeparator()

Initializes a new instance of the AppBarSeparator class.

public : AppBarSeparator()public AppBarSeparator()Public Sub New()// This API is not available in Javascript.

Properties

DynamicOverflowOrder DynamicOverflowOrder DynamicOverflowOrder DynamicOverflowOrder

Gets or sets the order in which this item is moved to the CommandBar overflow menu.

public : int DynamicOverflowOrder { get; set; }public int DynamicOverflowOrder { get; set; }Public ReadWrite Property DynamicOverflowOrder As int// This API is not available in Javascript.
<AppBarSeparator DynamicOverflowOrder="int" .../>
Value
int int int int

The order in which this item is moved to the overflow menu relative to other items.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

For more info and guidelines, see the App bar and command bar article.

Starting in Windows 10, version 1607, CommandBar introduces a dynamic overflow feature. By default, PrimaryCommands automatically move in or out of the overflow area as the command bar width changes, for example, when users resize their app window. You can set the IsDynamicOverflowEnabled property to false to disable this behavior.

Dynamic overflow affects only the UI presentation of the commands, it doesn’t move commands from the PrimaryCommands collection to SecondaryCommands.

This property has an effect only when this element is in the CommandBar.PrimaryCommands collection and CommandBar.IsDynamicOverflowEnabled is true.

You can assign the same DynamicOverflowOrder value to more than one element. Elements with the same value move in and out of the overflow area at the same time.

Version compatibility

The DynamicOverflowOrder property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in this page, you must design and test your app to account for this. For more info, see Version adaptive code.

Note

Dynamic overflow is available when your app is compiled for Windows 10, version 1607 and running on version 1607 (or later). Dynamic overflow is not available when your app is compiled for a previous version or is running on a previous version.

To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use it without performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this property before you set it.

<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded">
    <AppBarButton x:Name="appBarButtonCut" Icon="Cut" Label="Cut"/>
    <AppBarButton x:Name="appBarButtonCopy" Icon="Copy" Label="Copy"/>
    <AppBarSeparator x:Name="appBarSeparator1"/>
    <AppBarButton x:Name="appBarButtonPaste" Icon="Paste" Label="Paste"/>
</CommandBar>
private void CommandBar_Loaded(object sender, RoutedEventArgs e)
{
    if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AppBarSeparator", "DynamicOverflowOrder"))
    {
        commandBar1.IsDynamicOverflowEnabled = true;
        appBarButtonCut.DynamicOverflowOrder = 1;
        appBarButtonCopy.DynamicOverflowOrder = 2;
        appBarSeparator1.DynamicOverflowOrder = 2;
        appBarButtonPaste.DynamicOverflowOrder = 3;
    }
}

DynamicOverflowOrderProperty DynamicOverflowOrderProperty DynamicOverflowOrderProperty DynamicOverflowOrderProperty

Identifies the DynamicOverflowOrder dependency property.

public : static DependencyProperty DynamicOverflowOrderProperty { get; }public static DependencyProperty DynamicOverflowOrderProperty { get; }Public Static ReadOnly Property DynamicOverflowOrderProperty As DependencyProperty// This API is not available in Javascript.
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

IsCompact IsCompact IsCompact IsCompact

Gets or sets a value that indicates whether the separator is shown with reduced padding.

public : PlatForm::Boolean IsCompact { get; set; }public bool IsCompact { get; set; }Public ReadWrite Property IsCompact As bool// This API is not available in Javascript.
<AppBarSeparator IsCompact="bool" .../>
Value
PlatForm::Boolean bool bool bool

True if the separator is shown in its compact state; otherwise, false. The default is false.

IsCompactProperty IsCompactProperty IsCompactProperty IsCompactProperty

Identifies the IsCompact dependency property.

public : static DependencyProperty IsCompactProperty { get; }public static DependencyProperty IsCompactProperty { get; }Public Static ReadOnly Property IsCompactProperty As DependencyProperty// This API is not available in Javascript.
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the IsCompact dependency property.

IsInOverflow IsInOverflow IsInOverflow IsInOverflow

Gets a value that indicates whether this item is in the overflow menu.

public : PlatForm::Boolean IsInOverflow { get; }public bool IsInOverflow { get; }Public ReadOnly Property IsInOverflow As bool// This API is not available in Javascript.
Value
PlatForm::Boolean bool bool bool

true if this item is in the overflow menu; otherwise, false.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

For more info and guidelines, see the App bar and command bar article.

Starting in Windows 10, version 1607, CommandBar introduces a dynamic overflow feature. By default, PrimaryCommands automatically move in or out of the overflow area as the command bar width changes, for example, when users resize their app window. You can set the IsDynamicOverflowEnabled property to false to disable this behavior.

Dynamic overflow affects only the UI presentation of the commands, it doesn’t move commands from the PrimaryCommands collection to SecondaryCommands.

When IsInOverflow is true for an AppBarSeparator, the separator bar is hidden rather than being shown in the overflow area.

Version compatibility

The IsInOverflow property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in this page, you must design and test your app to account for this. For more info, see Version adaptive code.

Note

Dynamic overflow is available when your app is compiled for Windows 10, version 1607 and running on version 1607 (or later). Dynamic overflow is not available when your app is compiled for a previous version or is running on a previous version.

To avoid exceptions when your app runs on previous versions of Windows 10, do not use this property without first performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this property before you use it.

if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AppBarSeparator", "IsInOverflow"))
{
    bool overflow = appBarSeparator1.IsInOverflow;
}

IsInOverflowProperty IsInOverflowProperty IsInOverflowProperty IsInOverflowProperty

Identifies the IsInOverflow dependency property.

public : static DependencyProperty IsInOverflowProperty { get; }public static DependencyProperty IsInOverflowProperty { get; }Public Static ReadOnly Property IsInOverflowProperty As DependencyProperty// This API is not available in Javascript.
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the IsInOverflow dependency property.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

See Also