Flyout Flyout Flyout Class

Definition

Represents a control that displays lightweight UI that is either information, or requires user interaction. Unlike a dialog, a Flyout can be light dismissed by clicking or tapping outside of it, pressing the device’s back button, or pressing the ‘Esc’ key.

public : class Flyout : FlyoutBase, IFlyout
public class Flyout : FlyoutBase, IFlyout
Public Class Flyout Inherits FlyoutBase Implements IFlyout
<Flyout>
    singleUIElement
</Flyout>

Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

A Flyout displays a message that requires user interaction.

Flyout control

Use a Flyout control for collecting information, for displaying more info, or for warnings and confirmations. Unlike a dialog, a Flyout does not create a separate window, and does not block other user interaction. To show a menu of items, use a MenuFlyout instead. For more info, including XAML and code examples, see Quickstart: Adding a Flyout.

A Flyout control (or MenuFlyout ) is 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 Flyout with other controls, use the FlyoutBase.AttachedFlyout attached property. When set as Button.Flyout, the Flyout displays when the button is tapped or otherwise invoked. When a Flyout 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 in this reference topic, there are other members of the base class FlyoutBase that are often used in typical Flyout scenarios:

Accessibility

If you use a Flyout with no focusable content-for example, with only text, as shown here-you should take some additional steps to ensure that your content is accessible. Specifically, you need to ensure that Windows Narrator or other screen readers can read the flyout’s content.

Flyout control with text content By default, there are properties set on the FlyoutPresenter that prevent it from receiving focus. This is the desired behavior when content inside the Flyout can receive focus. However, if the content inside the Flyout can’t receive focus, you should update to the FlyoutPresenterStyle to let the FlyoutPresenter receive focus instead. To do this, set IsTabStop to true and TabNavigation to Cycle on the flyout presenter style.

This example shows how to let the FlyoutPresenter receive focus so that the content is accessible.

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Button VerticalAlignment="Center" HorizontalAlignment="Center"
            Content="Open flyout">
        <Button.Flyout>
            <Flyout>
                <Flyout.FlyoutPresenterStyle>
                    <Style TargetType="FlyoutPresenter">
                        <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled"/>
                        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
                        <Setter Property="IsTabStop" Value="True"/>
                        <Setter Property="TabNavigation" Value="Cycle"/>
                    </Style>
                </Flyout.FlyoutPresenterStyle>
                <TextBlock TextWrapping="Wrap" Text="This is some text in a flyout."/>
            </Flyout>
        </Button.Flyout>
    </Button>
</Grid>

Constructors

Flyout() Flyout() Flyout()

Initializes a new instance of the Flyout class.

public : Flyout()
public Flyout()
Public Sub New()

Properties

AllowFocusOnInteraction AllowFocusOnInteraction AllowFocusOnInteraction

Inherited from FlyoutBase

AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty

Inherited from FlyoutBase

AllowFocusWhenDisabled AllowFocusWhenDisabled AllowFocusWhenDisabled

Inherited from FlyoutBase

AllowFocusWhenDisabledProperty AllowFocusWhenDisabledProperty AllowFocusWhenDisabledProperty

Inherited from FlyoutBase

AttachedFlyoutProperty AttachedFlyoutProperty AttachedFlyoutProperty

Inherited from FlyoutBase

Content Content Content

Gets or sets the content of the Flyout.

public : UIElement Content { get; set; }
public UIElement Content { get; set; }
Public ReadWrite Property Content As UIElement
<Flyout>
    singleUIElement
</Flyout>

Value
UIElement UIElement UIElement

The content of the Flyout.

ContentProperty ContentProperty ContentProperty

Gets the identifier for the Content dependency property.

public : static DependencyProperty ContentProperty { get; }
public static DependencyProperty ContentProperty { get; }
Public Static ReadOnly Property ContentProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the Content dependency property.

Dispatcher Dispatcher Dispatcher

Inherited from DependencyObject

ElementSoundMode ElementSoundMode ElementSoundMode

Inherited from FlyoutBase

ElementSoundModeProperty ElementSoundModeProperty ElementSoundModeProperty

Inherited from FlyoutBase

FlyoutPresenterStyle FlyoutPresenterStyle FlyoutPresenterStyle

Gets or sets the Style applied to the Flyout content.

public : Style FlyoutPresenterStyle { get; set; }
public Style FlyoutPresenterStyle { get; set; }
Public ReadWrite Property FlyoutPresenterStyle As Style
<Flyout FlyoutPresenterStyle={StaticResource styleResourceKey}/>

Value
Style Style Style

The applied Style for the Flyout content, if present; otherwise, null. The default is null.

Remarks

The Style element you use for a FlyoutPresenterStyle value must specify TargetType="FlyoutPresenter".

A Flyout itself isn't a control or even a UIElement, and thus doesn't have any properties to apply a Style to. Instead, you can style the properties of the internal FlyoutPresenter that is presenting the Content of a Flyout. The properties that can be styled are the dependency properties of the base ContentControl class or Control class, such as FontSize or Padding, or base element properties such as FrameworkElement.Margin that the FlyoutPresenter class inherits. You also can use the properties that are available on whichever element you're setting as Flyout.Content, and set values of those properties directly rather than styling the FlyoutPresenter.

See Also

FlyoutPresenterStyleProperty FlyoutPresenterStyleProperty FlyoutPresenterStyleProperty

Gets the identifier for the FlyoutPresenterStyle dependency property.

public : static DependencyProperty FlyoutPresenterStyleProperty { get; }
public static DependencyProperty FlyoutPresenterStyleProperty { get; }
Public Static ReadOnly Property FlyoutPresenterStyleProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the FlyoutPresenterStyle dependency property.

LightDismissOverlayMode LightDismissOverlayMode LightDismissOverlayMode

Inherited from FlyoutBase

LightDismissOverlayModeProperty LightDismissOverlayModeProperty LightDismissOverlayModeProperty

Inherited from FlyoutBase

OverlayInputPassThroughElement OverlayInputPassThroughElement OverlayInputPassThroughElement

Inherited from FlyoutBase

OverlayInputPassThroughElementProperty OverlayInputPassThroughElementProperty OverlayInputPassThroughElementProperty

Inherited from FlyoutBase

Placement Placement Placement

Inherited from FlyoutBase

PlacementProperty PlacementProperty PlacementProperty

Inherited from FlyoutBase

Target Target Target

Inherited from FlyoutBase

Methods

ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

Inherited from DependencyObject

CreatePresenter CreatePresenter CreatePresenter

Inherited from FlyoutBase

GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty)

Inherited from DependencyObject

GetAttachedFlyout(FrameworkElement) GetAttachedFlyout(FrameworkElement) GetAttachedFlyout(FrameworkElement)

Inherited from FlyoutBase

GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

Inherited from DependencyObject

Hide Hide Hide

Inherited from FlyoutBase

OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs) OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs) OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs)

Inherited from FlyoutBase

ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

Inherited from DependencyObject

RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback)

Inherited from DependencyObject

SetAttachedFlyout(FrameworkElement,FlyoutBase) SetAttachedFlyout(FrameworkElement,FlyoutBase) SetAttachedFlyout(FrameworkElement,FlyoutBase)

Inherited from FlyoutBase

SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object)

Inherited from DependencyObject

ShowAt(FrameworkElement) ShowAt(FrameworkElement) ShowAt(FrameworkElement)

Inherited from FlyoutBase

ShowAttachedFlyout(FrameworkElement) ShowAttachedFlyout(FrameworkElement) ShowAttachedFlyout(FrameworkElement)

Inherited from FlyoutBase

TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs) TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs) TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs)

Inherited from FlyoutBase

UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64)

Inherited from DependencyObject

Events

Closed Closed Closed

Inherited from FlyoutBase

Closing Closing Closing

Inherited from FlyoutBase

Opened Opened Opened

Inherited from FlyoutBase

Opening Opening Opening

Inherited from FlyoutBase

See Also