Share via


RenderOptions.GetCachingHint(DependencyObject) Método

Definición

Devuelve el valor de la propiedad adjunta CachingHint de un objeto de dependencia especificado.

public:
 static System::Windows::Media::CachingHint GetCachingHint(System::Windows::DependencyObject ^ target);
[System.Windows.AttachedPropertyBrowsableForType(typeof(System.Windows.Media.TileBrush))]
public static System.Windows.Media.CachingHint GetCachingHint (System.Windows.DependencyObject target);
[<System.Windows.AttachedPropertyBrowsableForType(typeof(System.Windows.Media.TileBrush))>]
static member GetCachingHint : System.Windows.DependencyObject -> System.Windows.Media.CachingHint
Public Shared Function GetCachingHint (target As DependencyObject) As CachingHint

Parámetros

target
DependencyObject

Objeto de dependencia del que se va a recuperar el valor de la propiedad adjunta CachingHint.

Devoluciones

CachingHint

Valor actual de la propiedad asociada CachingHint del objeto de dependencia especificado.

Atributos

Excepciones

El target especificado es null.

Ejemplos

En el ejemplo siguiente se muestra cómo recuperar los valores de sugerencia de almacenamiento en caché de un DrawingBrush.

// Get the caching hint option for the brush.
CachingHint cachingHint = RenderOptions.GetCachingHint(drawingBrush);

if (cachingHint == CachingHint.Cache)
{
    // Get the minimum and maximum relative sizes for regenerating the tiled brush.
    double minimum = RenderOptions.GetCacheInvalidationThresholdMinimum(drawingBrush);
    double maximum = RenderOptions.GetCacheInvalidationThresholdMaximum(drawingBrush);

    // Perform action based on cache values...
}
' Get the caching hint option for the brush.
Dim cachingHintOpt As CachingHint = RenderOptions.GetCachingHint(drawingBrush)

If cachingHintOpt = CachingHint.Cache Then
    ' Get the minimum and maximum relative sizes for regenerating the tiled brush.
    Dim minimum As Double = RenderOptions.GetCacheInvalidationThresholdMinimum(drawingBrush)
    Dim maximum As Double = RenderOptions.GetCacheInvalidationThresholdMaximum(drawingBrush)

    ' Perform action based on cache values...
End If

Se aplica a

Consulte también