RenderOptions.GetCachingHint(DependencyObject) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the value of the CachingHint attached property for a specified dependency object.
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
Parameters
- target
- DependencyObject
The dependency object from which to retrieve the value of the CachingHint attached property.
Returns
The current value of the CachingHint attached property on the specified dependency object.
- Attributes
Exceptions
The specified target
is null
.
Examples
The following example shows how to retrieve the caching hint values for a 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
Applies to
See also
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET