XAML Attribute Formatting
Is it just me or does the default setting for the XAML editor in Visual Studio make working with XAML more difficult?
If you want to make your life easier, change the Tools->Options setting to ‘Position each attribute on a separate line’.
What difference does it make? As you can see, below are two text boxes with all of the same properties set….
No wait, you can only see the properties of one, to see the properties of the other one you need to scroll horizontally, no problem I’ll just use my mouses horizontal scroll wheel….
No wait, it doesn’t have one of those, only a vertical scroller. Damn those mouse makers!
In C# it is possible to create a new object and set all of its properties all on one mega long horizontal line, but we don’t. Why? Because the code is more readable when you break it up vertically over a few lines. You can see all of the properties at once and you usually don’t need to scroll…and if you do you have a vertical scroll wheel on the mouse 🙂