TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
XAML Coding Standard
Search

ORG$006Checked automatically with code checker

Synopsis:Avoid giving properties a default value
Language:XAML
Severity Level:1
Category:Organization and Layout


Description:

XAML is quite verbose. You should avoid adding to the verbosity by specifying property values that the XAML parser can infer by default. A typical example of this is assigning the value 0 to the Margin and Padding properties. There are other examples, though, and you should be aware of them. You should also be aware that automated tools that generate XAML, such as Microsoft Expression Blend, don't always remove these redundant property values, and are therefore suboptimal in this respect.

  <Button x:Name="closeButton"
    Style="{DynamicResource CloseButtonStyle}"
    Margin="4,4,4,4"
    Padding="2,0,2,0"/>

  <Button x:Name="closeButton"
    Style="{DynamicResource CloseButtonStyle}"
    Margin="4"
    Padding="2,0"/>