Version

ValidateTargetTypeOfStyle Method

Verifies that the TargetType of the style is either null or is set to the targetType, an ancestor type or a descendant type.
Syntax
'Declaration
 
Public Shared Sub ValidateTargetTypeOfStyle( _
   ByVal style As Style, _
   ByVal targetType As Type, _
   ByVal propertyName As String _
) 
public static void ValidateTargetTypeOfStyle( 
   Style style,
   Type targetType,
   string propertyName
)

Parameters

style
The style in question (must not be null)
targetType
The expected target type (must not be null)
propertyName
The name of the property that is being set (must not be null). This is used for formatting an exception
Exceptions
ExceptionDescription
System.ArgumentNullExceptionIf either style, targtType or propertyName arguments are null.
System.ArgumentExceptionIf the TargetType of the style is incompatible with the passed in targetType.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also