winui-code-review
When to Use
Run a code review after the app builds and before committing. This catches quality issues that aren't build errors and aren't visible in UI tests — patterns that compile and run but are wrong, fragile, or slow.
How to Review
Read through the project's XAML and C# files and check each section below. The Microsoft.WindowsAppSDK.Analyzers Roslyn analyzer ships with the winui-dev-workflow skill and is injected when BuildAndRun.ps1 calls project-mode winapp run. The wrapper supplies a temporary file through the environment-backed MSBuild CustomAfterDirectoryBuildProps hook, preserving SDK composition and each project's normal Directory.Build.props discovery (including referenced projects), then restores the environment and removes the temporary file. Plain winapp run, dotnet build, and Visual Studio do not load the analyzer automatically; to enable it outside the wrapper, add the <Analyzer Include="..." /> and <Import Project="..." /> entries to the project's own Directory.Build.props (or wait for the planned NuGet package).
The analyzer catches a curated set of WinUI 3 / Windows App SDK issues with categorized 4-digit IDs:
- WUI0xxx — UWP → WinUI 3 API compatibility (
UwpXamlNamespace,Window.Current,CoreDispatcher,GetForCurrentView) - WUI1xxx — Migration-table data-driven hints (UWP API has WinAppSDK equivalent, no equivalent, feature-area hint)
- WUI2xxx — Runtime / layout / XAML pitfalls (raw
TabViewcontent, nestedx:Bindwithout fallback,x:BindwithoutMode, nullConverter, missingAutomationId, attached-property syntax) - WUI3xxx — MVVM patterns (old
[ObservableProperty]field syntax) - WUI4xxx — Interop (
WebView2not initialized, removed ONNX Runtime GenAI APIsWUI4101-WUI4103)
Every diagnostic ships at Warning severity (no rule is Error) and includes a helpLinkUri. Suppress noise with #pragma warning disable WUIxxxx or <NoWarn> as usual — the analyzer's SuppressionTests verify that pragma suppression round-trips correctly.