RenderOptions.GetCachingHint(DependencyObject) Método

Definição

Retorna o valor da propriedade CachingHint anexada para um objeto de dependência 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

O objeto de dependência do qual o valor da propriedade anexada CachingHint será recuperado.

Retornos

CachingHint

O valor atual da propriedade anexada CachingHint no objeto de dependência especificado.

Atributos

Exceções

O target especificado é null.

Exemplos

O exemplo a seguir mostra como recuperar os valores de dica de cache para um 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

Aplica-se a

Confira também