MenuFlyout MenuFlyout MenuFlyout Class

Represents a flyout that displays a menu of commands.

Syntax

Declaration

public class MenuFlyoutpublic class MenuFlyoutPublic Class MenuFlyout
<MenuFlyout>
  oneOrMoreItems
</MenuFlyout>

Inheritance Hierarchy

Inherited Members

, , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Remarks

MenuFlyout temporarily displays a list of commands or options related to what the user is currently doing.

Menu flyout control

Use a Flyout control to display single items and a MenuFlyout control to show a menu of items. For more info, including XAML and code examples, see Quickstart: Adding a MenuFlyout.

A MenuFlyout control can be used as the value of the Flyout property. This is usually set in XAML as part of a UI definition of the page. Button is the only control that has a dedicated Flyout property. To associate a MenuFlyout with other controls, use the AttachedFlyoutProperty attached property. When set as Flyout, the MenuFlyout displays when the button is tapped or otherwise invoked. When a MenuFlyout is assigned to other UI elements using AttachedFlyoutProperty, you must call either the ShowAt(Windows.UI.Xaml.FrameworkElement) method or the static ShowAttachedFlyout(Windows.UI.Xaml.FrameworkElement) method to display the flyout.

In addition to the members listed above, there are other members of the base class FlyoutBase that are often used in typical MenuFlyout scenarios:

Constructors summary

Initializes a new instance of the MenuFlyout class.

Properties summary

Gets the collection used to generate the content of the menu.

Gets or sets the style that is used when rendering the MenuFlyout.

Identifies the MenuFlyoutPresenterStyle dependency property.

Methods summary

Shows the flyout placed at the specified offset in relation to the specified target element.

Constructors

  • MenuFlyout()
    MenuFlyout()
    MenuFlyout()
    MenuFlyout()

    Initializes a new instance of the MenuFlyout class.

    public MenuFlyout()public MenuFlyout()Public Function MenuFlyout() As

Properties

  • Items
    Items
    Items
    Items

    Gets the collection used to generate the content of the menu.

    public IVector<MenuFlyoutItemBase> Items { get; }public IVector<MenuFlyoutItemBase> Items { get; }Public ReadOnly Property Items As IVector<MenuFlyoutItemBase>
    <MenuFlyout>
      oneOrMoreItems
    </MenuFlyout>
    

    Property Value

    • The collection that is used to generate the content of the menu, if it exists; otherwise, null. The default is an empty collection.

  • MenuFlyoutPresenterStyle
    MenuFlyoutPresenterStyle
    MenuFlyoutPresenterStyle
    MenuFlyoutPresenterStyle

    Gets or sets the style that is used when rendering the MenuFlyout.

    public Style MenuFlyoutPresenterStyle { get; set; }public Style MenuFlyoutPresenterStyle { get; set; }Public ReadWrite Property MenuFlyoutPresenterStyle As Style
    <MenuFlyout MenuFlyoutPresenterStyle="resourceReferenceToStyle"/>
    

    Property Value

    Remarks

    The TargetType value to use for the Style must be MenuFlyoutPresenter (not MenuFlyout).

    You can't style a MenuFlyout directly. Instead, you apply a style to the MenuFlyoutPresenter that provides the visuals for the flyout. You can also style MenuFlyoutItem and ToggleMenuFlyoutItem (they are controls) and you can use implicit styles to do so. Or, you can set UI-related properties on the MenuFlyoutItem and ToggleMenuFlyoutItem items directly.

  • MenuFlyoutPresenterStyleProperty
    MenuFlyoutPresenterStyleProperty
    MenuFlyoutPresenterStyleProperty
    MenuFlyoutPresenterStyleProperty

    Identifies the MenuFlyoutPresenterStyle dependency property.

    public static DependencyProperty MenuFlyoutPresenterStyleProperty { get; }public static DependencyProperty MenuFlyoutPresenterStyleProperty { get; }Public Static ReadOnly Property MenuFlyoutPresenterStyleProperty As DependencyProperty

    Property Value

Methods

  • ShowAt(Windows.UI.Xaml.UIElement,Windows.Foundation.Point)
    ShowAt(Windows.UI.Xaml.UIElement,Windows.Foundation.Point)
    ShowAt(Windows.UI.Xaml.UIElement,Windows.Foundation.Point)
    ShowAt(Windows.UI.Xaml.UIElement,Windows.Foundation.Point)

    Shows the flyout placed at the specified offset in relation to the specified target element.

    public void ShowAt(Windows.UI.Xaml.UIElement,Windows.Foundation.Point)public void ShowAt(Windows.UI.Xaml.UIElement,Windows.Foundation.Point)Public Function ShowAt(Windows.UI.Xaml.UIElement,Windows.Foundation.Point) As void

    Parameters

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ComposableAttribute
Windows.UI.Xaml.Markup.ContentPropertyAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute
Windows.Foundation.Metadata.ContractVersionAttribute

Details

Assembly

Windows.UI.Xaml.Controls.dll