XamlStyler
XamlStyler copied to clipboard
Only WPF Setter elements are considered for reordering
The "Reorder setters" feature only considers Setter elements that reside in the following xml namespace definition: https://github.com/Xavalon/XamlStyler/blob/82b68c5007959a67f3c38f869c1c5a38375214a7/src/XamlStyler/DocumentManipulation/DocumentManipulationService.cs#L87
As other elements (like Style) are not restricted in such way, it would be great to make use of this feature for other xaml frameworks, like AvaloniaUI.
I'm well aware of #300, but this seems to be an unnecessary restriction on Setters.
To Reproduce Create a new AvaloniaUI project and try to format the following code with the "Reorder setters" feature set to Property:
<Style Selector="Button">
<Setter Property="Margin" Value="1" />
<Setter Property="Background" Value="Gray" />
</Style>
Note: AvaloniaUI now seems to work well with the standard .xaml extension in VS2019 (no need for .axaml), so this is not an issue with file extensions.
FormatThicknessService also hardcodes this xml namespace, thus preventing correct formatting of all the configured Thickness attributes: https://github.com/Xavalon/XamlStyler/blob/master/src/XamlStyler/DocumentManipulation/FormatThicknessService.cs#L12-L13