Share via


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:
 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

Property Value

Boolean

bool

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

Windows requirements

Device family
Windows 10, version 1903 (introduced in 10.0.18362.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v8.0)

Remarks

This property is applicable only to apps running on the desktop. To check if the popup is actually constrained to the root bounds, check the IsConstrainedToRootBounds property.

In an app running on the 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.

Applies to

See also