Skip to content

refactor: integrate XamlStyler for SamplesApp XAML files#22941

Merged
MartinZikmund merged 7 commits intomasterfrom
worktree-xamlstyler
Apr 9, 2026
Merged

refactor: integrate XamlStyler for SamplesApp XAML files#22941
MartinZikmund merged 7 commits intomasterfrom
worktree-xamlstyler

Conversation

@MartinZikmund
Copy link
Copy Markdown
Member

@MartinZikmund MartinZikmund commented Apr 1, 2026

closes #19603

Summary

  • Adds XamlStyler as a local dotnet tool for consistent XAML formatting across src/SamplesApp/
  • Formats all ~1,480 existing SamplesApp XAML files with the new configuration
  • Adds a GitHub Actions CI check that fails PRs with unformatted XAML (passive mode)
  • Updates contributor documentation (code style guide, SamplesApp guide, add-sample skill, AGENTS.md)

Configuration highlights (src/SamplesApp/Settings.XamlStyler)

  • Tab indentation (matches .editorconfig)
  • First attribute stays on same line, continuations indented by 4 spaces
  • Attribute reordering enabled (x:Class → xmlns → x:Key/Name → layout → rest)
  • Safe defaults: no child reordering, design-time references preserved

For contributors

dotnet tool restore                    # one-time after clone
dotnet xstyler -d src/SamplesApp -r   # format all SamplesApp XAML
dotnet xstyler -f path/to/file.xaml   # format a single file

Test plan

  • dotnet tool restore succeeds
  • dotnet xstyler -d src/SamplesApp -r processes 1,480 files without errors
  • dotnet xstyler -d src/SamplesApp -r -p passes (idempotent check)
  • CI workflow triggers on PRs touching SamplesApp XAML
  • SamplesApp builds and runs correctly after formatting

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings April 1, 2026 13:02
@github-actions github-actions Bot added area/automation Categorizes an issue or PR as relevant to project automation kind/documentation labels Apr 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Integrates XamlStyler into the repo as a local .NET tool to enforce consistent XAML formatting in src/SamplesApp/, including a CI workflow to validate formatting and documentation updates to guide contributors.

Changes:

  • Added XamlStyler tool manifest (.config/dotnet-tools.json) and configuration (src/SamplesApp/Settings.XamlStyler).
  • Added a GitHub Actions workflow to check SamplesApp XAML formatting on PRs.
  • Reformatted SamplesApp XAML files and updated contributor-facing docs/process docs to include formatting steps.

Reviewed changes

Copilot reviewed 129 out of 1487 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ScrollViewTests/ScrollViewBlankPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ScrollViewTests/KeyboardNavigationSample.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RefreshContainerTests/RefreshVisualizerPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RefreshContainerTests/RefreshContainerTheming.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RefreshContainerTests/RefreshContainerScrollTop.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RefreshContainerTests/RefreshContainerOnImagePage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RefreshContainerTests/RefreshContainerNavigationSecondPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RefreshContainerTests/RefreshContainerNavigationFirstPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RefreshContainerTests/RefreshContainerNavigation.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RefreshContainerTests/RefreshContainerHorizontalScroll.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RatingControlTests/RatingControlBasic.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RadioButtonsTests/RadioButtonsInitialLoadSelected.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/RadioButtonsTests/RadioButtonsBasicPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ProgressRing/WinUIProgressRing_Slider.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ProgressRing/WinUIProgressRing_CustomSources.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ProgressRing/WinUIProgressRingPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ProgressRing/WinUIDeterminateProgressRing.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ProgressRing/ProgressRingHeightTest.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ProgressBar/WinUIProgressBarSimple.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/PipsPagerTests/PipsPagerExamples.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NumberBoxTests/NumberBox_Header.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NumberBoxTests/NumberBox_ExpressionTest.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NumberBoxTests/NumberBox_Description.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/TopMode/NavigationViewTopNavOverflowButtonPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/Regression/NavigationViewRS3Page.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/NavigationViewBasicPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/Hierarchical/HierarchicalNavigationViewDataBinding.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/Footer/PaneLayoutTestPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/FluentStyle/SettingsPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/FluentStyle/NavigationViewSample.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/FluentStyle/Item3Page.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/FluentStyle/Item2Page.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/FluentStyle/Item1Page.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/DialogWithNavView.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/CustomResources/NavigationViewItemTemplatePage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/Common/NavigationViewStretchPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/Common/NavigationViewSelectedItemEdgeCasePage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/Common/NavigationViewPageDataContext.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/Common/NavigationViewMinimalPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/Common/NavigationViewMenuItemStretchPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/Common/NavigationViewIsPaneOpenPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/Common/NavigationViewBlankPage1.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/NavigationViewTests/Common/NavigationViewAnimationPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ItemsViewTests/ItemsView_Nested.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ImageIconTests/ImageIconPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ExpanderTests/WinUIExpanderPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ExpanderTests/Expander_ScrollView.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ExpanderTests/Expander_Bindings_TemplatedControl.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ExpanderTests/ExpanderColorValidationPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarTests/CommandBar_Primary_And_Secondary.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/ExtraCommandBarFlyoutPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/CommandBarFlyoutTests/CommandBarFlyoutMainPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ColorPickerTests/ColorPickerSample.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/BreadcrumbTests/BreadcrumbBarPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/AnimatedIconTests/AnimatedIconPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Windowing/TitleBar_SetDragRectangles.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Windowing/TitleBarAndBorder.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Windowing/SingleWindowClose.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Windowing/OverlappedPresenterTests.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Windowing/ExtendContentIntoTitleBarWindow.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Windowing/DraggableRegionWindow.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Windowing/CustomTitleBar_Tests.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Windowing/CustomTitleBarWindow.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Windowing/AppWindowTitleBarProperties.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Windowing/AppWindowPresenters.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Windowing/AppWindowPositionAndSize.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Windowing/AppWindowFeatures.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI_Windowing/AppWindowClosing.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Microsoft_UI/ColorHelperTests.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/MessageDialogTests/MessageDialogTest.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Lottie/SampleLottieAnimation.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Lottie/LottieProgressPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/UITests.Shared/Lottie/LottieEmbeddedJson.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/Settings.XamlStyler Add XamlStyler configuration for SamplesApp formatting
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Styles/SampleControl.xaml Reformat XAML resource dictionaries to match XamlStyler rules
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Styles/Controls/_Controls.xaml Reformat XAML resource dictionaries to match XamlStyler rules
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Styles/Controls/ToggleButton.xaml Reformat XAML resource dictionaries to match XamlStyler rules
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Styles/Controls/TextBox.xaml Reformat XAML resource dictionaries to match XamlStyler rules
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Styles/Controls/TextBlock.xaml Reformat XAML resource dictionaries to match XamlStyler rules
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Styles/Controls/RadioButton.xaml Reformat XAML resource dictionaries to match XamlStyler rules
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Styles/Controls/ListViewItem.xaml Reformat XAML resource dictionaries to match XamlStyler rules
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Styles/Controls/ListView.xaml Reformat XAML resource dictionaries to match XamlStyler rules
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Styles/Controls/Button.xaml Reformat XAML resource dictionaries to match XamlStyler rules
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Styles/Application/_Application.xaml Reformat XAML resource dictionaries to match XamlStyler rules
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Styles/Application/Colors.xaml Reformat comments/structure to match XamlStyler rules
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Controls/SampleInfoControl.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/SamplesApp.Shared/Samples/UnitTests/UnitTestsPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/SamplesApp.Shared/Samples/UnitTests/HttpUnitTests.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/SamplesApp.Shared/Samples/Help/HelpPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/SamplesApp.Shared/MainPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/Benchmarks.Shared/Controls/BenchmarkDotNetTestsPage.xaml Reformat XAML to match XamlStyler rules
src/SamplesApp/Benchmarks.Shared/Controls/BenchmarkDotNetControl.xaml Reformat XAML to match XamlStyler rules
doc/articles/uno-development/working-with-the-samples-apps.md Document XAML formatting step for new samples
doc/articles/contributing/guidelines/code-style.md Add documented XamlStyler workflow and commands
AGENTS.md Add XAML formatting step to contributor/runbook guidance
.github/workflows/xaml-style-check.yml Add CI job to validate XAML formatting in SamplesApp
.config/dotnet-tools.json Add local dotnet tool manifest for XamlStyler
.claude/skills/add-sample/SKILL.md Update sample-creation instructions to include formatting step

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/SamplesApp/UITests.Shared/Lottie/LottieProgressPage.xaml Outdated
Comment thread src/SamplesApp/UITests.Shared/Lottie/SampleLottieAnimation.xaml Outdated
Comment thread .github/workflows/xaml-style-check.yml
@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22941/wasm-skia-net9/index.html

@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22941/docs/index.html

@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22941/wasm-skia-net9/index.html

@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22941/docs/index.html

@unodevops
Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 205175 has failed on Uno.UI - CI.

Copilot AI review requested due to automatic review settings April 2, 2026 11:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 121 out of 1452 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/SamplesApp/Settings.XamlStyler Outdated
Comment thread src/SamplesApp/Settings.XamlStyler
Comment thread .config/dotnet-tools.json Outdated
Comment thread .github/workflows/xaml-style-check.yml Outdated
@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22941/wasm-skia-net9/index.html

@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22941/docs/index.html

@unodevops
Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 205184 has failed on Uno.UI - CI.

MartinZikmund and others added 5 commits April 7, 2026 14:59
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 7, 2026 13:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 122 out of 1456 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/SamplesApp/Settings.XamlStyler
@MartinZikmund MartinZikmund changed the title chore: integrate XamlStyler for SamplesApp XAML files refactor: integrate XamlStyler for SamplesApp XAML files Apr 7, 2026
@MartinZikmund MartinZikmund enabled auto-merge April 7, 2026 13:06
@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-22941/wasm-skia-net9/index.html

@unodevops
Copy link
Copy Markdown
Contributor

🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-22941/docs/index.html

@MartinZikmund MartinZikmund requested a review from ajpinedam April 7, 2026 20:40
@MartinZikmund MartinZikmund merged commit afe65bd into master Apr 9, 2026
45 checks passed
@MartinZikmund MartinZikmund deleted the worktree-xamlstyler branch April 9, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use XAML Styler for Samples app

4 participants