RenderOptions.SetCacheInvalidationThresholdMaximum 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
設定所指定相依性物件的 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
要設定屬性的目標新值。
例外狀況
指定的 target
為 null
。
範例
下列範例示範如何使用 的 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 附加屬性。