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.

傳回

Geometry

裁剪幾何。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. 當為時,預設的實值一律 null ClipToBounds 會傳回 falseThe default implementation always returns null when ClipToBounds is false. 這個方法會覆寫 UIElement.GetLayoutClipThis method overrides UIElement.GetLayoutClip. FrameworkElement執行會 MaxHeight MaxWidth 在其計算中使用和。The 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. Canvas.GetLayoutClip 如果為,則傳回 InkPresenter.GetLayoutClip null ClipToBounds falseCanvas.GetLayoutClip and InkPresenter.GetLayoutClip return null if ClipToBounds is false.

給繼承者的注意事項

當為時,預設的實值一律 null ClipToBounds 會傳回 falseThe 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.

適用於

另請參閱