RenderOptions.SetCacheInvalidationThresholdMinimum 方法

定义

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

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

参数

target
DependencyObject

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

cacheInvalidationThresholdMinimum
Double

要将此属性设为的新值。

例外

指定的 targetnull

示例

如下示例演示如何对 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)

注解

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

适用于

另请参阅