Share via


FlyoutBase 類別

定義

表示飛出視窗控件的基類,例如 飛出視窗MenuFlyout

public ref class FlyoutBase : DependencyObject
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class FlyoutBase : DependencyObject
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public class FlyoutBase : DependencyObject
Public Class FlyoutBase
Inherits DependencyObject
繼承
Object Platform::Object IInspectable DependencyObject FlyoutBase
衍生
屬性

備註

注意

搭配 XAML Islands (DesktopWindowXamlSource) 使用時:根據預設,此控件會自動限制在其顯示 的工作區域內 。 若要變更此行為,請設定包含此控件之 XAML 島之 DesktopWindowXamlSource.ShouldConstrainPopupsToWorkArea 屬性。

FlyoutBase 衍生類別

FlyoutBase 是 FlyoutMenuFlyout 的父類別。

XAML 附加屬性

FlyoutBase 是 XAML 附加屬性的主機服務類別。

為了支援 XAML 處理器存取附加屬性,以及公開對等 的 getset 作業給程式代碼,每個 XAML 附加屬性都有一對 Get 和 Set 存取子方法。 在程式代碼中取得或設定值的另一種方式是使用相依性屬性系統,呼叫 GetValueSetValue ,並將標識符字段傳遞為相依性屬性識別符。

附加屬性 Description
AttachedFlyout 取得或設定附加至 FrameworkElement 的飛出視窗。若要將飛出視窗附加至 Button,請改用 Button.Flyout

建構函式

FlyoutBase()

提供 FlyoutBase 衍生類別的基類初始化行為。

屬性

AllowFocusOnInteraction

取得或設定值,這個值表示當使用者與其互動時,專案是否會自動取得焦點。

AllowFocusOnInteractionProperty

識別 AllowFocusOnInteraction 相依性屬性。

AllowFocusWhenDisabled

取得或設定值,指定控件在停用時是否可以接收焦點。

AllowFocusWhenDisabledProperty

識別 AllowFocusWhenDisabled 相依性屬性。

AreOpenCloseAnimationsEnabled

取得或設定值,這個值表示當飛出窗口開啟或關閉時,是否播放動畫。

AreOpenCloseAnimationsEnabledProperty

識別 AreOpenCloseAnimationsEnabled 相依性屬性。

AttachedFlyoutProperty

識別 FlyoutBase.AttachedFlyout XAML 附加屬性。

Dispatcher

一律會在 Windows 應用程式 SDK 應用程式中傳回null。 請改用 DispatcherQueue

(繼承來源 DependencyObject)
DispatcherQueue

DispatcherQueue取得與這個 物件相關聯的 。 DispatcherQueue表示即使程式代碼是由非 UI 線程起始,也可以存取 DependencyObject UI 線程上的 。

(繼承來源 DependencyObject)
ElementSoundMode

取得或設定值,指定控件是否播放音效的喜好設定。

ElementSoundModeProperty

識別 ElementSoundMode 相依性屬性。

InputDevicePrefersPrimaryCommands

取得值,指出用來開啟飛出視窗的輸入設備是否不會輕易開啟次要命令。

InputDevicePrefersPrimaryCommandsProperty

識別 InputDevicePrefersPrimaryCommands 相依性屬性。

IsConstrainedToRootBounds

取得值,指出飛出視窗是否顯示在 XAML 根目錄的界限內。 對於 Windows 應用程式 SDK 應用程式,此屬性一律為 true

IsOpen

取得值,指出飛出視窗是否開啟。

IsOpenProperty

識別 IsOpen 相依性屬性。

LightDismissOverlayMode

取得或設定值,這個值會指定 淺色關閉 UI 外部的區域是否變暗。

LightDismissOverlayModeProperty

識別 LightDismissOverlayMode 相依性屬性。

OverlayInputPassThroughElement

取得或設定專案,即使飛出視窗重疊下方也應該接收指標輸入事件。

OverlayInputPassThroughElementProperty

識別 OverlayInputPassThroughElement 相依性屬性。

Placement

取得或設定相對於其放置目標之飛出視窗使用的預設放置位置。

PlacementProperty

識別 Placement 相依性屬性。

ShouldConstrainToRootBounds

取得或設定值,這個值表示是否應該在 XAML 根目錄的界限內顯示飛出視窗。

ShouldConstrainToRootBoundsProperty

識別 ShouldConstrainToRootBounds 相依性屬性。

ShowMode

取得或設定值,指出顯示飛出窗口的行為。

ShowModeProperty

識別 ShowMode 相依性屬性。

SystemBackdrop

取得或設定要套用至這個飛出視窗的系統底線。 飛出視窗內容後方會轉譯背景。

SystemBackdropProperty

識別 SystemBackdrop 相依性屬性。

Target

取得做為飛出視窗放置目標的 元素。

TargetProperty

識別 目標 相依性屬性。

XamlRoot

取得或設定正在檢視這個飛出視窗的 XamlRoot。

附加屬性

AttachedFlyout

取得或設定附加至 FrameworkElement 的飛出視窗。

方法

ClearValue(DependencyProperty)

清除相依性屬性的本機值。

(繼承來源 DependencyObject)
CreatePresenter()

在衍生類別中覆寫時,初始化 控件,以針對衍生控件顯示飛出視窗內容。 注意:這個方法沒有基類實作,而且必須在衍生類別中覆寫。

GetAnimationBaseValue(DependencyProperty)

傳回針對相依性屬性所建立的任何基底值,如果動畫未使用中,則會套用。

(繼承來源 DependencyObject)
GetAttachedFlyout(FrameworkElement)

取得與指定專案相關聯的飛出視窗。

GetValue(DependencyProperty)

DependencyObject 傳回相依性屬性的目前有效值。

(繼承來源 DependencyObject)
Hide()

關閉飛出視窗。

OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs)

在應用程式中處理鍵盤快捷方式 (快捷鍵) 之前呼叫。 每當應用程式程式代碼或內部進程呼叫 ProcessKeyboardAccelerators 時叫用。 覆寫此方法以影響預設加速器處理。

ReadLocalValue(DependencyProperty)

如果已設定本機值,則傳回相依性屬性的本機值。

(繼承來源 DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

註冊通知函式,以接聽此 DependencyObject 實例上特定 DependencyProperty 的變更。

(繼承來源 DependencyObject)
SetAttachedFlyout(FrameworkElement, FlyoutBase)

將指定的飛出視窗與指定的 FrameworkElement 產生關聯。

SetValue(DependencyProperty, Object)

DependencyObject 上設定相依性屬性的本機值。

(繼承來源 DependencyObject)
ShowAt(DependencyObject, FlyoutShowOptions)

使用指定的選項顯示相對於指定專案放置的飛出視窗。

ShowAt(FrameworkElement)

顯示相對於指定專案放置的飛出視窗。

ShowAttachedFlyout(FrameworkElement)

顯示與指定專案相關聯的飛出視窗,如果有的話。

TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs)

嘗試叫用鍵盤快捷方式 (快捷鍵) 。

UnregisterPropertyChangedCallback(DependencyProperty, Int64)

取消先前透過呼叫 RegisterPropertyChangedCallback 註冊的變更通知。

(繼承來源 DependencyObject)

事件

Closed

發生於隱藏飛出視窗時。

Closing

發生於飛出視窗開始隱藏時。

Opened

發生於顯示飛出視窗時。

Opening

在顯示飛出視窗之前發生。

適用於

另請參閱