VS2008 XAML formatting code

On my team, the style of the code in the .xaml files is currently not very consistent. We looked at Visual Studio AutoFormat to format the code into something we like. However, for one option, we lack an additional condition. The options I'm talking about are located under Tools → Options → Text Editor → XAML → Formatting.

We want each attribute to be on a separate line. Initially, we also wanted to get the first attribute in a new line (below the beginning of the tag) as follows:

<MyFooBarButton
    Attrib1="a"
    Attrib2="b" />

But we quickly realized that running with these rules would make tags that only set one attribute look awful, especially if they were nested:

<MyFooBarButton
    Attrib1="a" />
    <NestedFoo
        Attrib="b" />
        <NestedFoo2
            Attrib="c" />

, , . ( , ). :

<MyFooBarButton Attrib1="a"
                Attrib2="b" />

<MyFooBarButton Attrib1="a" />
    <NestedFoo Attrib="b" />
        <NestedFoo2 Attrib="c" />

, Visual Studio, , . :.

  • : .
  • : , .

Visual Studio 2008 ? , ReSharper ( )?

+5

All Articles