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

ORG$007Checked automatically with code checker

Synopsis:Consider using the concise format for attribute value assignment
Language:XAML
Severity Level:1
Category:Organization and Layout


Description:

Again, you should try not to add to the natural verbosity of XAML. Attributes such as Margin and Padding accept abbreviated values that apply in the order provided, symmetrically and logically. For instance, Margin="20" will be interpreted to mean a Thickness with all properties set to 20. Margin="20,50" will be interpreted to mean a Thickness with Left and Right set to 20, and Top and Bottom set to 50.

  <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"/>