共用方式為


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

範例

下列範例示範如何使用 的 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 附加屬性。

適用於

另請參閱