Represents a flyout that displays a menu of commands.
The MenuFlyout class has these types of members:
The MenuFlyout class has these constructors.
|MenuFlyout||Initializes a new instance of the MenuFlyout class.|
The MenuFlyout class has these events.
|Closed||Occurs when the flyout is hidden. (Inherited from FlyoutBase)|
|Opened||Occurs when the flyout is shown. (Inherited from FlyoutBase)|
|Opening||Occurs before the flyout is shown. (Inherited from FlyoutBase)|
The MenuFlyout class has these methods. It also inherits methods from the Object class.
|ClearValue||Clears the local value of a dependency property. (Inherited from DependencyObject)|
|CreatePresenter||When overridden in a derived class, initializes a control to show the flyout content as appropriate for the derived control. Note: This method has no base class implementation and must be overridden in a derived class. (Inherited from FlyoutBase)|
|GetAnimationBaseValue||Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)|
|GetValue||Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject)|
|Hide||Closes the flyout. (Inherited from FlyoutBase)|
|ReadLocalValue||Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject)|
|SetValue||Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)|
|ShowAt||Shows the flyout placed in relation to the specified element. (Inherited from FlyoutBase)|
The MenuFlyout class has these properties.
|Read-only||Gets the CoreDispatcher that this object is associated with. The CoreDispatcher represents a facility that can access the DependencyObject on the UI thread even if the code is initiated by a non-UI thread. (Inherited from DependencyObject)|
|Read-only||Gets the collection used to generate the content of the menu.|
|Read/write||Gets or sets the style that is used when rendering the MenuFlyout.|
|Read-only||Identifies the MenuFlyoutPresenterStyle dependency property.|
|Read/write||Gets or sets the default placement to be used for the flyout, in relation to its placement target. (Inherited from FlyoutBase)|
MenuFlyout temporarily displays a list of commands or options related to what the user is currently doing.
A MenuFlyout control can be used as the value of the Button.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 FlyoutBase.AttachedFlyout attached property. When set as Button.Flyout, the MenuFlyout displays when the button is tapped or otherwise invoked. When a MenuFlyout is assigned to other UI elements using FlyoutBase.AttachedFlyout, you must call either the ShowAt method or the static ShowAttachedFlyout 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:
- FlyoutBase.AttachedFlyout: an attached property that associates a MenuFlyout with a particular UI element (this can be any FrameworkElement derived class).
- ShowAttachedFlyout: a static method that can determine whether a flyout is already associated with a UI element through a FlyoutBase.AttachedFlyout usage. If so, the method calls ShowAt internally, using the FrameworkElement that you specified.
Minimum supported client
|Windows 8.1 [Windows Store apps only]|
Minimum supported server
|Windows Server 2012 R2 [Windows Store apps only]|
Minimum supported phone
|Windows Phone 8.1 [Windows Runtime apps only]|
- Quickstart: Adding a MenuFlyout
- How to add a menu to an app bar
- Attached properties overview
- XAML Flyout and MenuFlyout sample
- Related controls
- Controls list
- Controls by function