MenuFlyout class

Applies to Windows and Windows Phone

Represents a flyout that displays a menu of commands.

Inheritance

Object
  DependencyObject
    FlyoutBase
      MenuFlyout

Syntax


public class MenuFlyout : FlyoutBase


<MenuFlyout>
  oneOrMoreItems
</MenuFlyout>

XAML Values

oneOrMoreItems

Sets of MenuFlyoutItem elements. Can also include MenuFlyoutSeparator elements between groups of items, or ToggleMenuFlyoutItem elements.

Attributes

[ContentProperty("Name=Items")]
[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06030000)]
[WebHostHidden()]

Members

The MenuFlyout class has these types of members:

Constructors

The MenuFlyout class has these constructors.

ConstructorDescription
MenuFlyout Initializes a new instance of the MenuFlyout class.

 

Events

The MenuFlyout class has these events.

EventDescription
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)

 

Methods

The MenuFlyout class has these methods. It also inherits methods from the Object class.

MethodDescription
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)

 

Properties

The MenuFlyout class has these properties.

PropertyAccess typeDescription

Dispatcher

Read-onlyGets 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)

Items

Read-onlyGets the collection used to generate the content of the menu.

MenuFlyoutPresenterStyle

Read/writeGets or sets the style that is used when rendering the MenuFlyout.

MenuFlyoutPresenterStyleProperty

Read-onlyIdentifies the MenuFlyoutPresenterStyle dependency property.

Placement

Read/writeGets or sets the default placement to be used for the flyout, in relation to its placement target. (Inherited from FlyoutBase)

 

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 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:

Requirements

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]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

FlyoutBase
MenuFlyoutPresenter
Button.Flyout
FlyoutBase.AttachedFlyout
Quickstart: Adding a MenuFlyout
How to add a menu to an app bar
Attached properties overview
XAML Flyout and MenuFlyout sample
Related controls
Flyout
Controls list
Controls by function

 

 

Show:
© 2015 Microsoft