Skip to content

Attribute Formatting

David Grochocki edited this page Sep 7, 2017 · 8 revisions

Attribute Indentation

Defines the number of spaces that attributes are indented on elements with more than one line of attributes. A value of 0 will align indentation with the first attribute.

Default Value: 0

 <!-- Attribute Indentation = -1 (effective indentation is 0) -->
 <TextBlock
 FontSize="12"
 FontWeight="Bold"
 Foreground="Black"
 Text="Attribute Indentation" />

 <!-- Attribute Indentation = 0 (default; effective indentation respects VS settings, which is 4 by default) -->
 <TextBlock
     FontSize="12"
     FontWeight="Bold"
     Foreground="Black"
     Text="Attribute Indentation" />

 <!-- Attribute Indentation = 2 (effective indentation is 2) -->
 <TextBlock
   FontSize="12"
   FontWeight="Bold"
   Foreground="Black"
   Text="Attribute Indentation" />

 <!-- Attribute Indentation = 10 (effective indentation is 10) -->
 <TextBlock
           FontSize="12"
           FontWeight="Bold"
           Foreground="Black"
           Text="Attribute Indentation" />

Attribute Indentation Style

Defines how attributes are indented. Options: Mixed (tabs, if using them, then spaces), Spaces (always use spaces).

Default Value: Spaces

Attribute Tolerance

Defines the maximum number of attributes allowed on a single line. If the number of attributes exceeds this value, XAML Styler will break the attributes up across multiple lines. A value of less than 1 means always break up the attributes.

Default Value: 2

Attribute Tolerance Example

Keep First Attribute On Same Line

Defines whether the first line of attribute(s) should appear on the same line as the element's start tag.

Default Value: false

Keep First Attribute On Same Line Example

Max Attribute Characters Per Line

Defines the maximum character length of attributes an element can have on each line after the start tag (not including indentation characters). A value of less than 1 means no limit. Note: This setting only takes effect if Max Attributes Per Line is greater than 1 and Attribute Tolerance is greater than 2.

Default Value: 0

Max Attribute Characters Per Line Example

Max Attributes Per Line

Defines the maximum number of attributes an element can have on each line after the start tag if the number of attributes exceeds the Attribute Tolerance. A value of less than 1 means no limit.

Default Value: 1

Max Attributes Per Line Example

Newline Exemption Elements

Defines a list of elements whose attributes should not be broken across lines.

Default Value: RadialGradientBrush, GradientStop, LinearGradientBrush, ScaleTransfom, SkewTransform, RotateTransform, TranslateTransform, Trigger, Setter

Newline Exemption Elements

Remove Design-Time References

Defines whether design-time references automatically added to new pages and controls should be removed.

Default Value: false

Separate By Groups

Defines whether attributes belonging to different rule groups should be put on separate lines, while, if possible, keeping attributes in the same group on the same line.

Default Value: false

Separate By Groups Example