Share via


ScrollContentPresenter.SizesContentToTemplatedParent 屬性

定義

取得或設定值,這個值表示當在 ScrollViewer 的 ControlTemplate 中使用時,演示者會將 其 Content 的大小限制為擁有 ScrollViewer 大小。

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

屬性值

Boolean

bool

如果演示者將其 Content 大小限製為擁有 ScrollViewer 大小,則為 true;否則為 false。 預設值為 false

備註

根據預設,當 ScrollContentPresenter 在版面配置期間調整其 內容 的大小時,它會允許內容在 CanHorizontallyScrolltrue 時,讓內容盡可能寬,而且如果 CanVerticallyScrolltrue,則允許內容達到所需的高度。

ScrollViewerControlTemplate 中使用 ScrollContentPresenter 時,將 SizeContentToTemplatedParent 屬性設定為 true 會導致其 Content 的大小限制為擁有 ScrollViewer 大小。

適用於

另請參閱