Skip to content

Attribute Reordering

Dave Grochocki edited this page Sep 8, 2022 · 6 revisions

Enable Attribute Reordering

Defines whether attributes should be reordered. If false, attributes will not be reordered in any way.

Default Value: true

Enable Attribute Reordering Example

Attribute Ordering Rule Groups

Defines attribute ordering rule groups. Each string element is one group. Use ',' as a delimiter between attributes. 'DOS' wildcards are allowed. XAML Styler will order attributes in groups from top to bottom, and within groups left to right.

Default Value:

"x:Class",
"xmlns, xmlns:x",
"xmlns:*",
"x:Key, Key, x:Name, Name, x:Uid, Uid, Title",
"Grid.Row, Grid.RowSpan, Grid.Column, Grid.ColumnSpan, Canvas.Left, Canvas.Top, Canvas.Right, Canvas.Bottom",
"Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight",
"Margin, Padding, HorizontalAlignment, VerticalAlignment, HorizontalContentAlignment, VerticalContentAlignment, Panel.ZIndex",
"*:*, *",
"PageSource, PageIndex, Offset, Color, TargetName, Property, Value, StartPoint, EndPoint",
"mc:Ignorable, d:IsDataSource, d:LayoutOverrides, d:IsStaticText",
"Storyboard.*, From, To, Duration"

First Line Attributes

Defines a list of attributes which should always appear on the same line as the element's start tag. Attribute reordering must be enabled for this setting to take effect.

Default Value: None

First Line Attributes Example

Order Attributes by Name

Defines whether attributes should be ordered by name if not determined by a rule.

Default Value: true

Order Attributes by Name Example

Ignore Design-Time Reference Prefix

Defines whether attributes with the design-time reference namespace prefix are ignored when ordering.

Default Value: false