ScrollContentPresenter.SizesContentToTemplatedParent Property

Definition

Gets or sets a value that indicates whether, when used in the ControlTemplate for a ScrollViewer, the presenter restricts the size of its Content to the owning ScrollViewer size.

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

void SizesContentToTemplatedParent(bool value);
public bool SizesContentToTemplatedParent { get; set; }
var boolean = scrollContentPresenter.sizesContentToTemplatedParent;
scrollContentPresenter.sizesContentToTemplatedParent = boolean;
Public Property SizesContentToTemplatedParent As Boolean

Property Value

Boolean

bool

true if the presenter restricts its Content size to the owning ScrollViewer size; otherwise, false. The default is false.

Windows requirements

Device family
Windows 10, version 1809 (introduced in 10.0.17763.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v7.0)

Remarks

By default, when a ScrollContentPresenter is sizing its Content during layout, it allows the content to be as wide as the content desires if CanHorizontallyScroll is true, and allows the content to be as high as the content desires if CanVerticallyScroll is true.

When the ScrollContentPresenter is used in the ControlTemplate for a ScrollViewer, setting the SizesContentToTemplatedParent property to true causes it to restrict the size of its Content to the owning ScrollViewer size.

Applies to

See also