FrameworkElement.GetLayoutClip(Size) 方法

定義

傳回裁剪遮罩的幾何。Returns a geometry for a clipping mask. 如果配置系統嘗試排列大於可用顯示空間的項目,則會套用這個遮罩。The mask applies if the layout system attempts to arrange an element that is larger than the available display space.

protected:
 override System::Windows::Media::Geometry ^ GetLayoutClip(System::Windows::Size layoutSlotSize);
protected override System.Windows.Media.Geometry GetLayoutClip (System.Windows.Size layoutSlotSize);
override this.GetLayoutClip : System.Windows.Size -> System.Windows.Media.Geometry
Protected Overrides Function GetLayoutClip (layoutSlotSize As Size) As Geometry

參數

layoutSlotSize
Size

視覺呈現的項目部分大小。The size of the part of the element that does visual presentation.

傳回

裁剪幾何。The clipping geometry.

備註

邊界會從 layoutSlotSize 減去,做為版面配置系統行為的一部分。Margins will be subtracted from the layoutSlotSize as part of layout system behavior.

傳回的 null 參考指出不會進行裁剪。A returned null reference indicates that no clipping will occur. ClipToBounds false時,預設的執行一律會傳回 nullThe default implementation always returns null when ClipToBounds is false. 這個方法會覆寫 UIElement.GetLayoutClipThis method overrides UIElement.GetLayoutClip. FrameworkElement 的執行會使用其計算中的 MaxHeightMaxWidthThe FrameworkElement implementation uses MaxHeight and MaxWidth in its calculations. FrameworkElement 的數個子類別會重新覆寫此方法。Several subclasses of FrameworkElement override this method again. Adorner.GetLayoutClip,覆寫一律會傳回 null,因為裝飾項通常是故意在一般界限外。Adorner.GetLayoutClip, overrides to always return null because adorners are often deliberately outside the ordinary bounds. 如果 falseClipToBoundsCanvas.GetLayoutClipInkPresenter.GetLayoutClip 會傳回 nullCanvas.GetLayoutClip and InkPresenter.GetLayoutClip return null if ClipToBounds is false.

給繼承者的注意事項

ClipToBounds false時,預設的執行一律會傳回 nullThe default implementation always returns null when ClipToBounds is false. 根據衍生類別的關聯性和目的,以及其配置邏輯(相對於基類),覆寫通常會保留此行為,但有例外狀況。Overrides are generally expected to preserve this behavior, although there are exceptions, depending on the relationship and purpose of the derived class and its layout logic as opposed to the base class.

適用於

另請參閱