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.

返回的空引用指示将不会进行剪辑。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. 如果 ClipToBoundsfalse,则 Canvas.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.

适用于

另请参阅