Back to Devexpress

MenuFlyout Class

wpf-devexpress-dot-xpf-dot-windowsui-45cd6c95.md

latest4.0 KB
Original Source

MenuFlyout Class

A Windows-8 styled pop-up menu.

Namespace : DevExpress.Xpf.WindowsUI

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

NuGet Package : DevExpress.Wpf.Controls

Declaration

csharp
public class MenuFlyout :
    FlyoutBase,
    ILogicalOwner,
    IInputElement
vb
Public Class MenuFlyout
    Inherits FlyoutBase
    Implements ILogicalOwner,
               IInputElement

Remarks

The MenuFlyout is an evolution of traditional pop-up menus in Windows 8. It can only contain MenuFlyoutItem objects that represent regular menu items and MenuFlyoutSeparators that help to separate neighboring menu items. In fact, the MenuFlyout is a modified Flyout object designed to implement menus so you do not need to place your menu items into any sort of stack panel and manually arrange them into a column. The mark-up below illustrates how to create a simple flyout menu, assigned to the AppBarButton.

xaml
<dxwui:AppBarButton Label="Rotate" HorizontalAlignment="Right" Glyph="{dx:DXImage Image=DrillDown_32x32.png}" >
    <dxwui:AppBarButton.Flyout>
        <dxwui:MenuFlyout ShowIndicator="True">
            <dxwui:MenuFlyoutItem Content="90° clockwise" Command="{Binding RotateClockwise}" />
            <dxwui:MenuFlyoutItem Content="90° counter clockwise" Command="{Binding RotateCounterclockwise}" />
            <dxwui:MenuFlyoutItem Content="180°" Command="{Binding Rotate180}" />
            <dxwui:MenuFlyoutSeparator />
            <dxwui:MenuFlyoutItem Content="Reset" Command="{Binding RotateReset}" />
        </dxwui:MenuFlyout>
    </dxwui:AppBarButton.Flyout>
</dxwui:AppBarButton>

The figure below shows the result.

Note

MenuFlyout objects allow you to implement only one-level menus. Currently there is no built-in functionality to create sub-flyouts.

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

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#L18

xml
<dxwui:AppBarButton.Flyout>
    <dxwui:MenuFlyout ShowIndicator="True">
        <dxwui:MenuFlyoutItem Content="90° clockwise" />

Inheritance

Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control DevExpress.Xpf.WindowsUI.Internal.Flyout.FlyoutBase MenuFlyout

See Also

MenuFlyout Members

DevExpress.Xpf.WindowsUI Namespace