Back to Devexpress

AppBar.Alignment Property

wpf-devexpress-dot-xpf-dot-windowsui-dot-appbar.md

latest3.7 KB
Original Source

AppBar.Alignment Property

Gets or sets the AppBar alignment, relative to the parent FrameworkElement. This is a dependency property.

Namespace : DevExpress.Xpf.WindowsUI

Assembly : DevExpress.Xpf.Controls.v25.2.dll

NuGet Package : DevExpress.Wpf.Controls

Declaration

csharp
public AppBarAlignment Alignment { get; set; }
vb
Public Property Alignment As AppBarAlignment

Property Value

TypeDescription
DevExpress.Xpf.WindowsUI.AppBarAlignment

An DevExpress.Xpf.WindowsUI.AppBarAlignment enumeration value that specifies the AppBar alignment. The default value is Bottom.

|

Remarks

In XAML, you can declare the AppBar control as a child of a FrameworkElement. Use the Alignment property to specify the side of the parent FrameworkElement at which the AppBar appears. The AppBarAlignment type provides the Bottom , Top , Left and Right options.

If you create a Modern UI Style application using a NavigationPage, you can display the AppBar at the top or bottom of this page with the help of the NavigationPage.TopAppBar and/or NavigationPage.BottomAppBar properties. Do not use the Alignment property for alignment purposes in this case.

To specify alignment of an AppBarButton or AppBarSeparator relative to an AppBar, use the AppBarButton.Alignment and AppBarSeparator.Alignment properties.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Alignment property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-appbar-display-windows-10-top-bottom-menu/CS/AppBarExample/MainWindow.xaml.cs#L30

csharp
{
    appBar.Alignment = DevExpress.Xpf.WindowsUI.AppBarAlignment.Top;
}

See Also

TopAppBar

BottomAppBar

AppBarButton

AppBarSeparator

AppBarButton.Alignment

AppBarSeparator.Alignment

AppBar Class

AppBar Members

DevExpress.Xpf.WindowsUI Namespace