Skip to content

Getting Started

Dave Grochocki edited this page Dec 28, 2023 · 9 revisions

Usage

Right-click with any file and select "Format XAML" to format your XAML source code.

Context Menu

Special Characters

Special characters (e.g., &) are preserved.

Whitespace

"Significant whitespace" is respected. In other words, to prevent the rendering of unexpected spaces, newlines will not be added to <Run /> if it is immediately followed by another element. Please note that if you are mixing inline-level flow content elements with other text, you may need to specify xml:space="preserve" on the parent element in XAML to preserve whitespace properly.

Significant Whitespace between <Run />

Significant Whitespace Example

<TextBlock>
    <Run Text="A" />
    <Run Text="B" />
</TextBlock>
No Whitespace between <Run />

No Whitespace Example

<TextBlock>
    <Run Text="A" /><Run Text="B" />
</TextBlock>

Indentation

XAML Styler respects Visual Studio's indentation settings. You can change these options at Tools → Options → Text Editor → XAML → Tabs.

Visual Studio Tab Settings

Import/Export Settings

XAML Styler intergrates with Visual Studio's Import and Export Settings Wizzard.

Visual Studio Import/Export Settings