Share via


Popup.ShouldConstrainToRootBounds 屬性

定義

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

public:
 property bool ShouldConstrainToRootBounds { bool get(); void set(bool value); };
bool ShouldConstrainToRootBounds();

void ShouldConstrainToRootBounds(bool value);
public bool ShouldConstrainToRootBounds { get; set; }
var boolean = popup.shouldConstrainToRootBounds;
popup.shouldConstrainToRootBounds = boolean;
Public Property ShouldConstrainToRootBounds As Boolean

屬性值

Boolean

bool

如果快顯應該顯示在 XAML 根目錄的界限內,則為true;否則為false。 預設值為 True

Windows 需求

裝置系列
Windows 10, version 1903 (已於 10.0.18362.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v8.0 引進)

備註

此屬性僅適用于在桌面上執行的應用程式。 若要檢查快顯是否實際受限於根界限,請檢查 IsConstrainedToRootBounds 屬性。

在桌面上執行的應用程式中,當此屬性 為 true時,快顯視窗會顯示在主要 XAML 視窗控制碼中, (HWND) 。 當此屬性為 false時,快顯視窗會顯示在其自己的最上層 HWND 中。 在此情況下,快顯可能會定位為延伸至主要應用程式視窗之外。

第一次顯示具有 的 ShouldConstrainToRootBounds = false 快顯視窗時,它會放在自己的視窗中,並顯示在該內容中。 顯示之後, ShouldConstrainToRootBounds 無法重新設定為 true

XAML 根可能是CoreWindowXAML IslandAppWindow

適用於

另請參閱