-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XAML STYLER as a Git-Hook #1422
Comments
I can do this 😇 |
@chingucoding or @karkarl any thoughts? |
Thanks so much for tackling this @Jay-o-Way! As you know already cleaning up the XAML is in the backlog as part of the efforts to clean up the codebase. I like the idea of a |
Thanks for the positive comment @karkarl :) Imma need a bit more specific answers to adress this, mainly the choice between a one-time (manual) execution or the workflow solution. (easy versus not-so-easy, resp.) |
Sorry for hoping on this topic so late, I think if we don't do it as part of the CI or a git hook (if that is an option), slowly this would diverge again. I think having a config for this is also necessary to avoid mixed formatting based on who is doing it. The issue you linked though is a bit worrysome, is there a way to work around that formatting of text? |
If it's done via a central hook, this is a non-issue, because the changes are not made by people. :) Default settings should be fine (to start with)
You mean the unintended changes with spaces? I believe setting the |
@niels9001 Currently, there are a lot of RichTextBlock + Paragraph constructions. Mostly used for formatting text and including Hyperlinks. Adjusting them to add (totally random example) <RichTextBlock xml:space="preserve">
<Paragraph>To use the keyboard with a control, the control must have focus. The most common way to receive focus is via <Bold>Tab navigation</Bold>, which cycles through controls that are <Bold>tab stops</Bold>. The order of these tab stops is called the <Bold>tab order</Bold>.</Paragraph>
<Paragraph>All interactive controls, like buttons, should be tab stops (unless they are in a group that's accessible in some other way), but non-interactive controls, like labels, should not. Try to put initial focus on the most useful or logical element.</Paragraph>
<Paragraph>See <Hyperlink NavigateUri="https://learn.microsoft.com/windows/apps/design/input/keyboard-interactions">Keyboard interactions</Hyperlink> and <Hyperlink NavigateUri="https://learn.microsoft.com/windows/apps/design/accessibility/keyboard-accessibility">Keyboard accessibility</Hyperlink>.</Paragraph>
</RichTextBlock> |
Also, cases like the following might be too much XAML for simple text <RichTextBlock
x:Name="ErrorTextBlock"
Grid.Row="1"
Margin="0,0,0,12"
Foreground="{ThemeResource SystemFillColorCriticalBrush}"
IsTextSelectionEnabled="True"
Visibility="Collapsed">
<Paragraph xml:space="preserve">
This sample requires a later version of Windows to be fully functional.
</Paragraph>
</RichTextBlock> |
Linking this to this task in backlog #1279 |
Alternatively, we could add XAML Styler to .vsconfig? |
Example of pr: files-community/Files#15115 |
Issue type
enhancement
Which version of the app?
WinUI 3 Gallery
Description
https://github.com/Xavalon/XamlStyler/wiki/Git-Hook
Additional context
Tasks
Note
Need to set
xml:space="preserve"
in elements first, in order to prevent the following:In a paragraph of text, a <Hyperlink> or a <Bold> will be stripped of a preceding space. By contrast, a period following a </Hyperlink> or a </Bold> wil be placed on a new line. This will insert a [space] in the UI.
The text was updated successfully, but these errors were encountered: