Sharpnado's Xamarin.Forms XamlStyler config file
A quick post here to highlight a must-have visual studio extension that I really love: XamlStyler
It helps you to get a consistent xml formatting between all your xaml files by setting rules in the
Settings.XamlStyler config file, or directly in the extension.
It's available for VS 2017/2019 on windows.
But also on VS 2019 for mac \o/.
It also exists as a console app, really nice to make the build break if some team partner is not following the team guidelines :)
As you can see you can set the order of your attribute.
You can also auto format the xaml on save.
Or decide if you want to have the first attribute on the first line and align all the others on this one, or have no attribute on the first line, and have the first one under the element tag indented according to the books (/!\ warning /!\ inflammable topic).
So this extension is really nice, but it has a little issue for us
Xamarin.Forms dev, all the attributes are
WPF XAML attributes. Some are the same in XF, but some are different like
But since the config is editable you can add all your XF attributes \o/
I created a
Settings.XamlStyler json file supporting all the
Xamarin.Forms attributes for all my projects and decided to share it with you. So you won't start from nothing :)
Also I find the configuration by
json file much easier to handle than the extension setting. You can commit it at the same level than your solution project and it will be picked up by all sub folders (high five o/ \o).
/!\ warning /!\ The
XamlStyler config file HAS to be named
Settings.XamlStyler or it won't be processed by the extension.
Of course it still supports the
WPF attributes so it can be used with both framework.