Popup.ShouldConstrainToRootBounds Popup.ShouldConstrainToRootBounds Popup.ShouldConstrainToRootBounds Popup.ShouldConstrainToRootBounds Property

Definition

Gets or sets a value that indicates whether the popup should be shown within the bounds of the XAML root.

public : Platform::Boolean ShouldConstrainToRootBounds { get; set; }
bool ShouldConstrainToRootBounds();

void ShouldConstrainToRootBounds(bool shouldconstraintorootbounds);
public bool ShouldConstrainToRootBounds { get; set; }
Public ReadWrite Property ShouldConstrainToRootBounds As bool

Property Value

bool bool

true if the popup should be shown within the bounds of the XAML root; otherwise, false. The default is true.

Additional features and requirements

Device family
Windows 10, version 1903 (introduced v10.0.18362.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v8)

Remarks

This property is applicable only to apps running on the desktop. On other platforms, it does not have an effect. To check if the popup is actually constrained to the root bounds, check the IsConstrainedToRootBounds property.

In a UWP app on desktop, when this property is true, the popup is shown within the main XAML window handle (HWND). When this property is false, the popup is shown in its own top level HWND. In this case, the popup might be positioned to extend beyond the main app window.

When a popup with ShouldConstrainToRootBounds = false is first shown, it’s placed in its own window and shown in that context. After it has been shown, ShouldConstrainToRootBounds cannot be set back to true.

The XAML root might be a CoreWindow, a XAML island, or an AppWindow.

See also