I suggest you ...

Allow Single-Line Nested Elements when Reformatting XAML

When Visual Studio 2015 reformats my XAML (which I do not want to have happen without my permission), the part that bothers me the most is when nested elements are split into multiple lines. For example, I may have something like:
<element1><element2><element3><element4/></element3></element2></element1>
and it gets reformatted to:
<element1>
<element2>
<element3>
<element4/>
</element3>
</element2>
</element1>
This changes this section of my code from 1 line to 7 lines. Even things as small as nesting just 1 level can significantly lengthen your code, not to mention make it much uglier. I would like reformatting to have the option of preserving single-line nesting rather than putting every element on a separate line.

3 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Nathan Sokalski shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • Fred commented  ·   ·  Flag as inappropriate

    This happens many times in VS. Essentially, XML/HTML/XAML based elements are reformatted without regard to their content. XAML will be reformatted to have adjacent controls on a window on many extra lines in the XAML file.

    This makes comparing one control to another much harder. Consider a dialog with 4 text boxes next to one another with only the background color different between them. One would like to vertically scan the XAML settings for each text box one setting at a time to see that they are all the same except for the background color.

    This happens in .NET C# .config files, xaml, html, ...

Feedback and Knowledge Base