FrameworkElement.GetLayoutClip(Size) Method

Definition

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.

C#
protected override System.Windows.Media.Geometry GetLayoutClip(System.Windows.Size layoutSlotSize);

Parameters

layoutSlotSize
Size

The size of the part of the element that does visual presentation.

Returns

The clipping geometry.

Remarks

Margins will be subtracted from the layoutSlotSize as part of layout system behavior.

A returned null reference indicates that no clipping will occur. The default implementation always returns null when ClipToBounds is false. This method overrides UIElement.GetLayoutClip. The FrameworkElement implementation uses MaxHeight and MaxWidth in its calculations. Several subclasses of FrameworkElement override this method again. Adorner.GetLayoutClip, overrides to always return null because adorners are often deliberately outside the ordinary bounds. Canvas.GetLayoutClip and InkPresenter.GetLayoutClip return null if ClipToBounds is false.

Notes to Inheritors

The 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.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also