TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
 
XAML Coding Standard
Search

Coding Rules

Rule Kind
Checked automatically with code checker
Severity Level


NameCheckedSynopsis
MIS$001 Checked automatically with code checker Do be aware that windows, dialogs, message boxes, and popups are the root of their own visual tree
NAM$001 Checked automatically with code checker Do use US English
NAM$002 Checked automatically with code checker Consider giving each logical XAML element a unique name
NAM$003 Checked automatically with code checker Do use x:Name instead of Name to give XAML elements a unique name
NAM$004 Checked automatically with code checker Do use x:Key to give resources a unique name
NAM$005 Checked automatically with code checker Avoid giving a XAML element both an x:Key and an x:Name
NAM$006 Checked automatically with code checker Do use camel casing for the x:Name
NAM$007 Checked automatically with code checker Do use Pascal casing for the x:Key
NAM$008 Checked automatically with code checker Do postfix the x:Name with the type of the XAML element
NAM$009 Checked automatically with code checker Do postfix the x:Key with the type of the XAML element
NAM$010 Consider providing meaningful names for your XAML elements
NAM$011 Do prefix the x:Name of template parts with PART_
NAM$012 Checked automatically with code checker Consider using brief or abbreviated namespace aliases
NAM$014 Checked automatically with code checker Do use lowercase letters for namespace aliases
NAM$015 Checked automatically with code checker Consider using the same namespace aliases throughout your project
ORG$001 Checked automatically with code checker Do make the x:Name directive the first property after a XAML type instance
ORG$002 Checked automatically with code checker Consider putting the XAML element type and the x:Name together on the first line
ORG$003 Checked automatically with code checker Consider putting the Style property on the second line
ORG$004 Checked automatically with code checker Consider putting related properties on the same line
ORG$005 Checked automatically with code checker Organize properties in the right order
ORG$006 Checked automatically with code checker Avoid giving properties a default value
ORG$007 Checked automatically with code checker Consider using the concise format for attribute value assignment
ORG$008 Checked automatically with code checker Consider using the concise format for assigning the path of a binding expression
ORG$009 Checked automatically with code checker Do use spaces instead of tabs in your XAML files
ORG$010 Checked automatically with code checker Do use an indentation of four spaces in your XAML files
RES$001 Do use StaticResource if you can, DynamicResource if you must
RES$002 Checked automatically with code checker Do use StaticResource to define the based-on type for implicit styles
RES$003 Checked automatically with code checker Consider freezing objects that are freezable
STY$001 Checked automatically with code checker Do specify the target type of your style using the TargetType="{x:Type TypeName}" syntax
STY$002 Checked automatically with code checker Consider introducing implicit styles to avoid duplication of XAML code
VAL$001 Checked automatically with code checker Do let custom value converters return DependencyProperty.UnsetValue instead of null
VAL$002 Consider enhancing your custom value converters with markup extensions