Synopsis: | Do specify the target type of your style using the TargetType="{x:Type TypeName}" syntax |
Language: | XAML |
Severity Level: | 1 |
Category: | Styles |
Description: |
If you need to specify the target type of your style explicitly, you should favor the syntax that uses the x:Type markup extension. The reason for this is primarily that it guarantees consistency in your XAML code, but also that the use of the Typename-as-String alternative may lead to problems. ✘ ✔ This recommendation also holds for other attributes that expect a Type value, such as ControlTemplate.TargetType or RelativeSource.AncestorType. |