FlyoutBase FlyoutBase FlyoutBase FlyoutBase Class

Definition

Represents the base class for flyout controls, such as Flyout and MenuFlyout.

public : class FlyoutBase : DependencyObject, IFlyoutBase, IFlyoutBase2, IFlyoutBase3, IFlyoutBaseOverrides
struct winrt::Windows::UI::Xaml::Controls::Primitives::FlyoutBase : DependencyObject, IFlyoutBase, IFlyoutBase2, IFlyoutBase3, IFlyoutBaseOverrides
public class FlyoutBase : DependencyObject, IFlyoutBase, IFlyoutBase2, IFlyoutBase3, IFlyoutBaseOverrides
Public Class FlyoutBase Inherits DependencyObject Implements IFlyoutBase, IFlyoutBase2, IFlyoutBase3, IFlyoutBaseOverrides
Inheritance
FlyoutBaseFlyoutBaseFlyoutBaseFlyoutBase
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

FlyoutBase derived classes

FlyoutBase is the parent class for Flyout and MenuFlyout.

Constructors

FlyoutBase() FlyoutBase() FlyoutBase() FlyoutBase()

Provides base class initialization behavior for FlyoutBase derived classes.

protected : FlyoutBase()
FlyoutBase() const;
protected FlyoutBase()
Protected Sub New()

Properties

AllowFocusOnInteraction AllowFocusOnInteraction AllowFocusOnInteraction AllowFocusOnInteraction

Gets or sets a value that indicates whether the element automatically gets focus when the user interacts with it.

public : Platform::Boolean AllowFocusOnInteraction { get; set; }
bool AllowFocusOnInteraction(); void AllowFocusOnInteraction(bool allowfocusoninteraction);
public bool AllowFocusOnInteraction { get; set; }
Public ReadWrite Property AllowFocusOnInteraction As bool
<flyoutAllowFocusOnInteraction="bool"/>
Value
bool bool

true if the element gets focus when a user interacts with it; otherwise, false.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

Available starting in Windows 10, version 1607.

AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty

Identifies the AllowFocusOnInteraction dependency property.

public : static DependencyProperty AllowFocusOnInteractionProperty { get; }
static DependencyProperty AllowFocusOnInteractionProperty();
public static DependencyProperty AllowFocusOnInteractionProperty { get; }
Public Static ReadOnly Property AllowFocusOnInteractionProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the AllowFocusOnInteraction dependency property.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

AllowFocusWhenDisabled AllowFocusWhenDisabled AllowFocusWhenDisabled AllowFocusWhenDisabled

Gets or sets a value that specifies whether the control can receive focus when it's disabled.

public : Platform::Boolean AllowFocusWhenDisabled { get; set; }
bool AllowFocusWhenDisabled(); void AllowFocusWhenDisabled(bool allowfocuswhendisabled);
public bool AllowFocusWhenDisabled { get; set; }
Public ReadWrite Property AllowFocusWhenDisabled As bool
Value
bool bool

true if the control can receive focus when it's disabled; otherwise, false.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

AllowFocusWhenDisabledProperty AllowFocusWhenDisabledProperty AllowFocusWhenDisabledProperty AllowFocusWhenDisabledProperty

Identifies the AllowFocusWhenDisabled dependency property.

public : static DependencyProperty AllowFocusWhenDisabledProperty { get; }
static DependencyProperty AllowFocusWhenDisabledProperty();
public static DependencyProperty AllowFocusWhenDisabledProperty { get; }
Public Static ReadOnly Property AllowFocusWhenDisabledProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the AllowFocusWhenDisabled dependency property.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

AttachedFlyoutProperty AttachedFlyoutProperty AttachedFlyoutProperty AttachedFlyoutProperty

Identifies the FlyoutBase.AttachedFlyout XAML attached property.

public : static DependencyProperty AttachedFlyoutProperty { get; }
static DependencyProperty AttachedFlyoutProperty();
public static DependencyProperty AttachedFlyoutProperty { get; }
Public Static ReadOnly Property AttachedFlyoutProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the FlyoutBase.AttachedFlyout XAML attached property.

Dispatcher Dispatcher Dispatcher Dispatcher

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)

ElementSoundMode ElementSoundMode ElementSoundMode ElementSoundMode

Gets or sets a value that specifies the control's preference for whether it plays sounds.

public : ElementSoundMode ElementSoundMode { get; set; }
ElementSoundMode ElementSoundMode(); void ElementSoundMode(ElementSoundMode elementsoundmode);
public ElementSoundMode ElementSoundMode { get; set; }
Public ReadWrite Property ElementSoundMode As ElementSoundMode
Value
ElementSoundMode ElementSoundMode

An enumeration value that specifies the control's preference for whether it plays sounds. The default is Default.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

For more info, see Sound in UWP apps.

See Also

ElementSoundModeProperty ElementSoundModeProperty ElementSoundModeProperty ElementSoundModeProperty

Identifies the ElementSoundMode dependency property.

public : static DependencyProperty ElementSoundModeProperty { get; }
static DependencyProperty ElementSoundModeProperty();
public static DependencyProperty ElementSoundModeProperty { get; }
Public Static ReadOnly Property ElementSoundModeProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the ElementSoundMode dependency property.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

LightDismissOverlayMode LightDismissOverlayMode LightDismissOverlayMode LightDismissOverlayMode

Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.

public : LightDismissOverlayMode LightDismissOverlayMode { get; set; }
LightDismissOverlayMode LightDismissOverlayMode(); void LightDismissOverlayMode(LightDismissOverlayMode lightdismissoverlaymode);
public LightDismissOverlayMode LightDismissOverlayMode { get; set; }
Public ReadWrite Property LightDismissOverlayMode As LightDismissOverlayMode
Value
LightDismissOverlayMode LightDismissOverlayMode

A value of the enumeration that specifies whether the area outside of a light-dismiss UI is darkened. The default is Auto.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

Transient UI, such as a Flyout or MenuFlyout, closes when you click or tap outside of it. This is called light-dismiss. "Overlay" refers to the area outside of a light-dismiss UI.

By default, the "overlay" is darkened on the Xbox, and not darkened on other devices families. You can set LightDismissOverlayMode to On to make your app darken the "overlay" area on all device families, or set it to Off to not darken the "overlay" area on all device families.

LightDismissOverlayModeProperty LightDismissOverlayModeProperty LightDismissOverlayModeProperty LightDismissOverlayModeProperty

Identifies the LightDismissOverlayMode dependency property.

public : static DependencyProperty LightDismissOverlayModeProperty { get; }
static DependencyProperty LightDismissOverlayModeProperty();
public static DependencyProperty LightDismissOverlayModeProperty { get; }
Public Static ReadOnly Property LightDismissOverlayModeProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the LightDismissOverlayMode dependency property.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

OverlayInputPassThroughElement OverlayInputPassThroughElement OverlayInputPassThroughElement OverlayInputPassThroughElement

Gets or sets an element that should receive pointer input events even when underneath the flyout's overlay.

public : DependencyObject OverlayInputPassThroughElement { get; set; }
DependencyObject OverlayInputPassThroughElement(); void OverlayInputPassThroughElement(DependencyObject overlayinputpassthroughelement);
public DependencyObject OverlayInputPassThroughElement { get; set; }
Public ReadWrite Property OverlayInputPassThroughElement As DependencyObject
Value
DependencyObject DependencyObject

The element that should receive pointer input events even when underneath the flyout's overlay.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

OverlayInputPassThroughElementProperty OverlayInputPassThroughElementProperty OverlayInputPassThroughElementProperty OverlayInputPassThroughElementProperty

Identifies the OverlayInputPassThroughElement dependency property.

public : static DependencyProperty OverlayInputPassThroughElementProperty { get; }
static DependencyProperty OverlayInputPassThroughElementProperty();
public static DependencyProperty OverlayInputPassThroughElementProperty { get; }
Public Static ReadOnly Property OverlayInputPassThroughElementProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the OverlayInputPassThroughElement dependency property.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Placement Placement Placement Placement

Gets or sets the default placement to be used for the flyout, in relation to its placement target.

public : FlyoutPlacementMode Placement { get; set; }
FlyoutPlacementMode Placement(); void Placement(FlyoutPlacementMode placement);
public FlyoutPlacementMode Placement { get; set; }
Public ReadWrite Property Placement As FlyoutPlacementMode
<flyoutPlacement="flyoutPlacementModeMemberName" />
Value
FlyoutPlacementMode FlyoutPlacementMode

A named constant of the enumeration that indicates where the flyout is placed in relation to its placement target. The default is Top.

See Also

PlacementProperty PlacementProperty PlacementProperty PlacementProperty

Identifies the Placement dependency property.

public : static DependencyProperty PlacementProperty { get; }
static DependencyProperty PlacementProperty();
public static DependencyProperty PlacementProperty { get; }
Public Static ReadOnly Property PlacementProperty As DependencyProperty
Value
DependencyProperty DependencyProperty

The identifier for the Placement dependency property.

Target Target Target Target

Gets the element to use as the flyout's placement target.

public : FrameworkElement Target { get; }
FrameworkElement Target();
public FrameworkElement Target { get; }
Public ReadOnly Property Target As FrameworkElement
<flyoutTarget="flyoutPlacementTarget" />
Value
FrameworkElement FrameworkElement

The element to use as the flyout's placement target.

Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

Available starting in Windows 10, version 1607.

Methods

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

Clears the local value of a dependency property.

(Inherited from DependencyObject)

CreatePresenter() CreatePresenter() CreatePresenter() 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.

protected : virtual Control CreatePresenter()
Control CreatePresenter() const;
protected virtual Control CreatePresenter()
Protected Overridable Function CreatePresenter() As Control
Returns

The control that displays the content of the flyout.

Remarks

This method has no base class implementation and must be overridden in a derived class.

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

Returns any base value established for a dependency property, which would apply in cases where an animation is not active.

(Inherited from DependencyObject)

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

Gets the flyout associated with the specified element.

public : static FlyoutBase GetAttachedFlyout(FrameworkElement element)
FlyoutBase GetAttachedFlyout(FrameworkElement element) const;
public static FlyoutBase GetAttachedFlyout(FrameworkElement element)
Public Static Function GetAttachedFlyout(element As FrameworkElement) As FlyoutBase
Parameters
element
FrameworkElement FrameworkElement

The element for which to get the associated flyout.

Returns

The flyout attached to the specified element.

See Also

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

Returns the current effective value of a dependency property from a DependencyObject.

(Inherited from DependencyObject)

Hide() Hide() Hide() Hide()

Closes the flyout.

public : void Hide()
void Hide() const;
public void Hide()
Public Function Hide() As void

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

Called just before a keyboard shortcut (accelerator) is processed in your app. Invoked whenever application code or internal processes call ProcessKeyboardAccelerators. Override this method to influence the default accelerator handling.

protected : virtual void OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs args)
void OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs args) const;
protected virtual void OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs args)
Protected Overridable Function OnProcessKeyboardAccelerators(args As ProcessKeyboardAcceleratorEventArgs) As void
Parameters
Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Examples

TryInvokeKeyboardAccelerator

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

Returns the local value of a dependency property, if a local value is set.

(Inherited from DependencyObject)

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

Registers a notification function for listening to changes to a specific DependencyProperty on this DependencyObject instance.

(Inherited from DependencyObject)

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

Associates the specified flyout with the specified FrameworkElement.

public : static void SetAttachedFlyout(FrameworkElement element, FlyoutBase value)
void SetAttachedFlyout(FrameworkElement element, FlyoutBase value) const;
public static void SetAttachedFlyout(FrameworkElement element, FlyoutBase value)
Public Static Function SetAttachedFlyout(element As FrameworkElement, value As FlyoutBase) As void
Parameters
element
FrameworkElement FrameworkElement

The element to associate the flyout with.

value
FlyoutBase FlyoutBase FlyoutBase FlyoutBase

The flyout to associate with the specified element.

See Also

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

Sets the local value of a dependency property on a DependencyObject.

(Inherited from DependencyObject)

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

Shows the flyout placed in relation to the specified element.

public : void ShowAt(FrameworkElement placementTarget)
void ShowAt(FrameworkElement placementTarget) const;
public void ShowAt(FrameworkElement placementTarget)
Public Function ShowAt(placementTarget As FrameworkElement) As void
Parameters
placementTarget
FrameworkElement FrameworkElement

The element to use as the flyout's placement target.

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

Shows the flyout associated with the specified element, if any.

public : static void ShowAttachedFlyout(FrameworkElement flyoutOwner)
void ShowAttachedFlyout(FrameworkElement flyoutOwner) const;
public static void ShowAttachedFlyout(FrameworkElement flyoutOwner)
Public Static Function ShowAttachedFlyout(flyoutOwner As FrameworkElement) As void
Parameters
flyoutOwner
FrameworkElement FrameworkElement

The element for which to show the associated flyout.

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

Attempts to invoke a keyboard shortcut (accelerator).

public : void TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs args)
void TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs args) const;
public void TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs args)
Public Function TryInvokeKeyboardAccelerator(args As ProcessKeyboardAcceleratorEventArgs) As void
Parameters
Additional features and requirements
Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Remarks

Call this method in the OnProcessKeyboardAccelerators override when an accelerator is invoked and you want to influence the default accelerator handling.

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

Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback.

(Inherited from DependencyObject)

Events

Closed Closed Closed Closed

Occurs when the flyout is hidden.

public : event EventHandler Closed<Platform::Object>
// Register
event_token Closed(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token
void Closed(event_token const& cookie) const;

// Revoke with event_revoker
Closed_revoker Closed(auto_revoker_t, EventHandler<Platform::Object> const& handler) const;
public event EventHandler Closed<object>
Public Event EventHandler Closed( Of ( Of object ))
<flyout Closed="eventhandler"/>

Closing Closing Closing Closing

Occurs when the flyout starts to be hidden.

public : event TypedEventHandler Closing<FlyoutBase, FlyoutBaseClosingEventArgs>
// Register
event_token Closing(TypedEventHandler<FlyoutBase, FlyoutBaseClosingEventArgs> const& handler) const;

// Revoke with event_token
void Closing(event_token const& cookie) const;

// Revoke with event_revoker
Closing_revoker Closing(auto_revoker_t, TypedEventHandler<FlyoutBase, FlyoutBaseClosingEventArgs> const& handler) const;
public event TypedEventHandler Closing<FlyoutBase, FlyoutBaseClosingEventArgs>
Public Event TypedEventHandler Closing( Of ( Of FlyoutBase ), ( Of FlyoutBaseClosingEventArgs ))
<flyout Closing="eventhandler"/>
Additional features and requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

Available starting in Windows 10, version 1607.

Opened Opened Opened Opened

Occurs when the flyout is shown.

public : event EventHandler Opened<Platform::Object>
// Register
event_token Opened(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token
void Opened(event_token const& cookie) const;

// Revoke with event_revoker
Opened_revoker Opened(auto_revoker_t, EventHandler<Platform::Object> const& handler) const;
public event EventHandler Opened<object>
Public Event EventHandler Opened( Of ( Of object ))
<flyout Opened="eventhandler"/>

Opening Opening Opening Opening

Occurs before the flyout is shown.

public : event EventHandler Opening<Platform::Object>
// Register
event_token Opening(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token
void Opening(event_token const& cookie) const;

// Revoke with event_revoker
Opening_revoker Opening(auto_revoker_t, EventHandler<Platform::Object> const& handler) const;
public event EventHandler Opening<object>
Public Event EventHandler Opening( Of ( Of object ))
<flyout Opening="eventhandler"/>