RenderOptions.SetCacheInvalidationThresholdMaximum 方法

定义

设置指定的依赖对象上的 CacheInvalidationThresholdMaximum 附加属性值。

public:
 static void SetCacheInvalidationThresholdMaximum(System::Windows::DependencyObject ^ target, double cacheInvalidationThresholdMaximum);
public static void SetCacheInvalidationThresholdMaximum (System.Windows.DependencyObject target, double cacheInvalidationThresholdMaximum);
static member SetCacheInvalidationThresholdMaximum : System.Windows.DependencyObject * double -> unit
Public Shared Sub SetCacheInvalidationThresholdMaximum (target As DependencyObject, cacheInvalidationThresholdMaximum As Double)

参数

target
DependencyObject

要在其上设置 CacheInvalidationThresholdMaximum 属性值的依赖对象。

cacheInvalidationThresholdMaximum
Double

要将此属性设为的新值。

例外

指定的 targetnull

示例

以下示例演示如何对 a DrawingBrush.

DrawingBrush drawingBrush = new DrawingBrush();
            
// Set the caching hint option for the brush.
RenderOptions.SetCachingHint(drawingBrush, CachingHint.Cache);

// Set the minimum and maximum relative sizes for regenerating the tiled brush.
// The tiled brush will be regenerated and re-cached when its size is
// 0.5x or 2x of the current cached size.
RenderOptions.SetCacheInvalidationThresholdMinimum(drawingBrush, 0.5);
RenderOptions.SetCacheInvalidationThresholdMaximum(drawingBrush, 2.0);
Dim drawingBrush As New DrawingBrush()

' Set the caching hint option for the brush.
RenderOptions.SetCachingHint(drawingBrush, CachingHint.Cache)

' Set the minimum and maximum relative sizes for regenerating the tiled brush.
' The tiled brush will be regenerated and re-cached when its size is
' 0.5x or 2x of the current cached size.
RenderOptions.SetCacheInvalidationThresholdMinimum(drawingBrush, 0.5)
RenderOptions.SetCacheInvalidationThresholdMaximum(drawingBrush, 2.0)

注解

使用此方法在代码中设置 CacheInvalidationThresholdMaximum 附加属性。

适用于

另请参阅