[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M699KV0Q6NE5EET5EDBH33NM":3,"skill-same:01M699KV0Q6NE5EET5EDBH33NM":95},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":53,"linkOnly":54,"markdownContent":55,"markdownBody":56,"frontMatter":57,"refName":58,"commitSha":59,"skillDirectory":60,"forksCount":61,"repositoryHtmlUrl":62,"repositoryHomepageUrl":17,"ownerHtmlUrl":63,"ownerBlogUrl":64,"ownerDescription":65,"updatedAt":66,"install":67,"resources":80},"01M699KV0Q6NE5EET5EDBH33NM","winui-design","WinUI XAML 界面设计","Read before writing or changing WinUI 3 XAML: choosing controls, pages and navigation, layout, Fluent Design, theming, accessibility, x:Bind, real samples, and checking that APIs exist with winapp find-api. Not for WPF or WinForms UI, even if the app uses the Windows App SDK.","在编写或更改 WinUI 3 XAML 之前阅读：控件、页面与导航的选择、布局、Fluent Design、主题、可访问性、x:Bind、真实示例，以及使用 winapp find-api 检查 API 是否存在。不适用于 WPF 或 WinForms UI，即使应用使用了 Windows App SDK。","microsoft\u002FwinappCli","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M699J7Q2FM9V32CFV0Q8VPF9",1381,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FwinappCli\u002Fblob\u002Fmain\u002Fplugins\u002Fwinui\u002Fagent-plugin\u002Fskills\u002Fwinui-design\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRASNPVNJVQQJ4KZX8XM5D","前端开发与界面实现","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],"winui design","winui","design","ui","fluent design","for","controls","winforms","app","bind","pages","layout","read","api","xaml","wpf","windows app sdk","windows","fluent","accessibility","sdk","writing","2026-11-10 10:12:30",false,"---\nname: winui-design\ndescription: \"Read before writing or changing WinUI 3 XAML: choosing controls, pages and navigation, layout, Fluent Design, theming, accessibility, x:Bind, real samples, and checking that APIs exist with winapp find-api. Not for WPF or WinForms UI, even if the app uses the Windows App SDK.\"\n---\n\n**Scope: WinUI 3 apps only.** The Windows App SDK is not WinUI. A WPF, WinForms, Electron, or other app that references the Windows App SDK (for notifications, packaging, or other APIs) is not a WinUI app; keep its framework and don't apply this skill unless the task is to port it to WinUI 3. A WinUI 3 project has `\u003CUseWinUI>true\u003C\u002FUseWinUI>` or uses `Microsoft.UI.Xaml`.\n\n## Search samples before writing XAML\n\nThis workflow requires WinApp CLI **0.7+**. Use `winapp find-ui` for grounded control and sample discovery. **Front-load lookups, then code**:\n\n```powershell\nwinapp find-ui \"\u003Cfocused feature>\"                    # compact matches + scenario IDs\nwinapp find-ui --id \u003Cscenario-id>                    # full XAML\u002FC# + prerequisite notes\nwinapp find-ui --id \u003Cid-1> --id \u003Cid-2> --json        # batch, structured output\nwinapp find-ui --list                                # browse all default-source scenarios\nwinapp find-ui \"\u003Cfeature>\" --refresh                 # force a corpus refresh\n```\n\nDefault search covers the WinUI Gallery, Windows Community Toolkit, and curated core patterns. Reactor's C#-only\u002FMVU samples are opt-in with `--source reactor`; use them only for Reactor projects. The Gallery\u002FToolkit\u002FReactor corpus is fetched and cached by WinApp CLI, while core patterns work offline.\n\n## Verify APIs against the restored project\n\nBefore coding API assumptions, run from the **restored app project directory** so `winapp find-api` uses its exact references, not a sample's possibly newer package versions:\n```powershell\nwinapp find-api InfoBar --json --project-dir .\nwinapp find-api check-property InfoBar Severity IsOpen Message Title --json --project-dir .\nwinapp find-api members NavigationView --filter selected --json --project-dir .\n```\nUse **either** `--project-dir \u003Capp-directory>` (defaults to cwd) **or** `--project \u003Cname>` to select among multiple projects, never both. An unscoped query from a repo root or sibling project may target the wrong API surface. `--project sdk` searches only the installed machine SDK, not the app's NuGet references. If results look stale, check restore\u002Fproject selection before refreshing. Use `winapp find-api --help` for discovery\u002Findex commands rather than guessing an API from memory; use `find-ui` for the usage pattern.\n\n## App-shape anchors\n\nPick the closest shipping app silhouette before laying out a page:\n\n| App type | Anchor controls | Reference apps |\n|----------|-----------------|----------------|\n| Settings \u002F config tool | `NavigationView` Left + `SettingsCard` \u002F `SettingsExpander` | Windows Settings, Slack |\n| Document \u002F session editor | `TabView` + full-bleed content, light chrome | Windows Terminal, VS Code, Notepad |\n| Hierarchical browser | `TreeView` + `ListView` + `BreadcrumbBar` | File Explorer, Outlook |\n| Developer tool \u002F dashboard | `NavigationView` + card layout | Dev Home, GitHub Desktop |\n| Single-purpose utility | Mode switcher + compact grid | Calculator, Snipping Tool |\n| Media \u002F canvas \u002F hero | `Grid` with hero surface, floating commands, **no** `NavigationView` | Photos, Spotify, Clipchamp |\n\n## Reach-for-this control map\n\nBefore writing XAML, map the requirement to a platform control. These mappings exist to short-circuit cross-framework instincts (WPF `DataGrid`, web `\u003Cselect>`, HTML `\u003Cinput type=date>`):\n\n- **Navigation:** 2–7 sections → `NavigationView`; document\u002Fsession tabs → `TabView`; breadcrumb trail → `BreadcrumbBar`; 2–3 modes → `SelectorBar`.\n- **Data display:** Vertical list → `ListView`; tiles\u002Fgrid → `GridView` or `ItemsRepeater` + `UniformGridLayout`; hierarchy → `TreeView`; **tabular → `ListView` with a `Grid`-based `ItemTemplate` and a header `Grid` above** (WinUI has no `DataGrid`; don't default to `CommunityToolkit.WinUI.Controls.DataGrid` — its columns can't use `x:Bind`); master-detail → `ListView` + detail `Grid`.\n- **Input:** Text → `TextBox`; number → `NumberBox`; search → `AutoSuggestBox`; date → `CalendarDatePicker`; boolean → `ToggleSwitch`; pick one from 2–3 → `RadioButtons`; pick one from 4+ → `ComboBox`.\n- **Feedback:** Blocking decision → `ContentDialog`; contextual action → `Flyout` \u002F `MenuFlyout`; onboarding \u002F hint → `TeachingTip`; inline status \u002F async progress → `InfoBar`; system notification → `AppNotification`.\n\nIf the mapping above doesn't fit, run `winapp find-ui \"\u003Cintent>\"` before improvising.\n\n## Window sizing (WinUI 3 specifics)\n\n> **WinUI 3 has no `SizeToContent`.** Without an explicit size, Windows defaults the main window to ~1024×768 — oversized for most utilities. Size it in `MainWindow`'s constructor.\n\n**Rubric.** Width = widest row + 48 padding, rounded up to nearest 20. Height = 32 (titlebar) + Σ(row heights) + Σ(spacing) + 48 padding, rounded up to 20. Round up — clipped content is a worse failure than a slightly-wide window. Sanity ranges (derive yours from the rubric):\n\n- Single-purpose utility → ~440–560 wide\n- Form \u002F single-page tool → ~600–800 wide, ~640–800 tall\n- Multi-pane (nav + content) → ~1100–1300 wide, ~720–840 tall\n- Document \u002F canvas \u002F media editor → 1280+ wide\n\n`AppWindow.Resize` takes **physical pixels**, not DIPs — multiply by the monitor's DPI scale. `XamlRoot.RasterizationScale` is null in the constructor and stale after `AppWindow.Move`, so `[DllImport] GetDpiForWindow` is the cleanest path:\n\n```csharp\nusing Microsoft.UI;\nusing Microsoft.UI.Windowing;\nusing System.Runtime.InteropServices;\nusing Windows.Graphics;\n\npublic sealed partial class MainWindow : Window\n{\n    [DllImport(\"user32.dll\")]\n    private static extern uint GetDpiForWindow(IntPtr hWnd);\n\n    public MainWindow()\n    {\n        InitializeComponent();\n        var hwnd  = Win32Interop.GetWindowFromWindowId(AppWindow.Id);\n        var scale = GetDpiForWindow(hwnd) \u002F 96.0;\n        \u002F\u002F widthDip \u002F heightDip come from the rubric above — derive, don't copy.\n        AppWindow.Resize(new SizeInt32((int)(widthDip * scale), (int)(heightDip * scale)));\n    }\n}\n```\n\nDon't size the window by setting `Width`\u002F`Height` on the root `Grid` — that clips content, not the window.\n\n## XAML landmines (the things you'll otherwise ship broken)\n\n### Check the effective `x:Bind` mode\n\n`x:Bind` defaults to `OneTime` **unless an inherited `x:DefaultBindMode` changes it**. Use `OneWay`\u002F`TwoWay` plus change notifications for dynamic data; explicit `Mode` overrides the inherited default. Stable command\u002Fevent bindings need no blanket mode rewrite.\n\n```xml\n\u003C!-- Without an inherited default, this is OneTime -->\n\u003CTextBlock Text=\"{x:Bind Vm.Status}\" \u002F>\n\u003C!-- Updates when Vm raises the relevant change notifications -->\n\u003CTextBlock Text=\"{x:Bind Vm.Status, Mode=OneWay}\" \u002F>\n```\n\nIn a page\u002Fwindow, `x:Bind` resolves against code-behind (e.g., its `Vm` property), not `DataContext`. Use `x:DataType` on typed **DataTemplates**, not on `Page` to set a VM. Runtime `{Binding}`\u002F`DisplayMemberPath` can be appropriate; for AOT, their source classes may need `partial` plus `[WinRT.GeneratedBindableCustomProperty]`. See `winui-packaging`'s `references\u002Fsourcegen-patterns.md` instead of treating all runtime binding as unsupported.\n\n### `TextBox` two-way needs `UpdateSourceTrigger=PropertyChanged`\n\n```xml\n\u003CTextBox Text=\"{x:Bind Vm.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\" \u002F>\n```\n\nDefault trigger resolves to `LostFocus` specifically for `TextBox.Text` (most other properties default to `PropertyChanged`). The VM is not updated per keystroke, and UIA keyboard-simulation tests (WinAppDriver `SendKeys`, etc.) that assert immediately after typing will see stale VM state until focus moves.\n\n### Attached properties from C# use static setters, not initializers\n\n```csharp\nusing Microsoft.UI.Xaml.Automation;\n\n\u002F\u002F ❌ WRONG — does not compile. CS0117: 'Button' does not contain a definition for 'AutomationProperties'.\n\u002F\u002F AutomationProperties is a static class of attached-property accessors, not an instance member.\nvar btn = new Button { AutomationProperties = { AutomationId = \"BtnSave\" } };\n\n\u002F\u002F ✅ CORRECT\nvar btn = new Button { Content = \"Save\" };\nAutomationProperties.SetAutomationId(btn, \"BtnSave\");\nAutomationProperties.SetName(btn, \"Save button\");\nGrid.SetRow(btn, 1);\nToolTipService.SetToolTip(btn, \"Save the current document\");\n```\n\n### `Converter={x:Null}` crashes `x:Bind` at runtime\n\n`{x:Bind}` requires `Converter` to be a `{StaticResource}` lookup. `Converter={x:Null}` compiles but the generated code calls `LookupConverter(\"\")`, which returns null, then dereferences it — you get `Resource Dictionary Key can only be String-typed` \u002F `NullReferenceException` on first activation of the binding. If you don't want a converter, omit the property entirely.\n\n### Prefer `x:Bind` static functions over `IValueConverter`\n\n```csharp\n\u002F\u002F MainPage.xaml.cs\npublic static Visibility BoolToVisibility(bool v) => v ? Visibility.Visible : Visibility.Collapsed;\npublic static Visibility InvertBoolToVisibility(bool v) => v ? Visibility.Collapsed : Visibility.Visible;\npublic static bool Not(bool v) => !v;\n```\n```xml\n\u003CTextBlock Visibility=\"{x:Bind local:MainPage.BoolToVisibility(Vm.IsLoading), Mode=OneWay}\" \u002F>\n\u003CButton   IsEnabled=\"{x:Bind local:MainPage.Not(Vm.IsLoading), Mode=OneWay}\" \u002F>\n```\n\n### Acrylic and `ThemeShadow` rendering rules\n\n- `BackgroundSizing` defaults to `InnerBorderEdge` on both `Border` and `Control`, which correctly clips acrylic to the inner stroke. The hazard is the opposite of intuition: don't *change* it to `OuterBorderEdge` on a bordered acrylic surface — that's what makes the material bleed past the stroke.\n- `ThemeShadow` casts a shadow from the caster's `Translation` Z. Microsoft's recommended elevations are `16` for tooltips, `32` for popup\u002Fflyout UI, `128` for dialogs — pick by surface type. For non-popup casters, add the surfaces it should land on to `ThemeShadow.Receivers`; otherwise the shadow has nothing to fall on and looks clipped.\n\n## Theming rules (short version)\n\n- `{ThemeResource ...}` at usage sites (updates on theme switch). `{StaticResource}` inside `ThemeDictionaries` for theme-local definitions; `SystemAccentColor` \u002F `SystemColor*` are the exceptions and stay `{ThemeResource}`.\n- Custom theme dictionaries cover `Light`, `Dark`, **and** `HighContrast` explicitly — never `Default`.\n- Name resources by purpose (`CardBackgroundBrush`, `DangerTextBrush`), not hue.\n- Light\u002FDark working ≠ High Contrast working. Test in a Contrast theme separately.\n- Never set `HighContrastAdjustment=\"None\"` unless your app already supplies system-aware brushes throughout.\n\n## Anti-patterns\n\n| ❌ Don't | ✅ Do instead |\n|---------|--------------|\n| Reflexively build every app as `NavigationView` Left | Pick the closest row in the silhouette table; hero \u002F document \u002F utility shapes are equally valid |\n| Treat brand colour or tinted backdrop as off-pattern | Overriding `SystemAccentColor` or using a tinted `DesktopAcrylicBackdrop` is how Microsoft's own first-party apps differentiate |\n| Tiny content island on an oversized window | Either size the window to the content (see *Window sizing*) or let content fill the available space |\n| Custom pill \u002F segmented tab switcher built by hand | `NavigationView` Top or `SelectorBar` |\n| Equal-width 50\u002F50 column split where one pane is structural | Stable size for the structural pane, flexible for content — only if a structural pane is part of the silhouette at all |\n| Hard-coded color literals (`#RRGGBB`, `White`) | `{ThemeResource}` brushes by semantic name |\n| `ScrollViewer` wrapped around a `ListView` \u002F `GridView` | The collection control already scrolls — give it a constrained height |\n| Custom `ControlTemplate` for a standard control | Built-in control + lightweight style overrides |\n| Placeholder text used as the only field label | Always provide a visible label |\n| Required commands hidden at small widths with no route | Overflow menu, secondary surface, or a responsive promotion rule |\n| Modal `ContentDialog` for non-blocking hints | `TeachingTip`, `InfoBar`, or inline status |\n| Destructive action (Delete \u002F Discard \u002F Reset) fired without confirmation | `ContentDialog` with verb-labelled primary action and `Cancel` secondary; surface item identity (name, count) in the body |\n| Custom list control when `ListView` \u002F `GridView` fits | Use the platform collection + virtualisation |\n\nBuild custom UI **only when all are true**: no platform\u002FGallery\u002FToolkit control fits; you'll implement keyboard, focus, UI Automation, theme resources, High Contrast, and responsive behaviour; you have specs for default\u002Fhover\u002Fpressed\u002Fdisabled\u002Fselected\u002Ffocused\u002Ferror states; you've tested with keyboard and a contrast theme.\n\n## References (load on demand)\n\n| File | Load when… |\n|------|-----------|\n| `references\u002Fbrushes-and-icons.md` | Looking up a brush key by purpose, picking between `Icon` \u002F `IconSource` slots, choosing among `FontIcon` \u002F `SymbolIcon` \u002F `PathIcon` \u002F etc. |\n| `references\u002Ftheme-accessibility.md` | Authoring theme dictionaries, custom brushes\u002Fstyles\u002Ftemplates, or High Contrast support. |\n| `references\u002Flayout-review.md` | Reviewing responsive behaviour, breakpoints, or empty\u002Floading\u002Ferror coverage on a data-driven page. |\n","**Scope: WinUI 3 apps only.** The Windows App SDK is not WinUI. A WPF, WinForms, Electron, or other app that references the Windows App SDK (for notifications, packaging, or other APIs) is not a WinUI app; keep its framework and don't apply this skill unless the task is to port it to WinUI 3. A WinUI 3 project has `\u003CUseWinUI>true\u003C\u002FUseWinUI>` or uses `Microsoft.UI.Xaml`.\n\n## Search samples before writing XAML\n\nThis workflow requires WinApp CLI **0.7+**. Use `winapp find-ui` for grounded control and sample discovery. **Front-load lookups, then code**:\n\n```powershell\nwinapp find-ui \"\u003Cfocused feature>\"                    # compact matches + scenario IDs\nwinapp find-ui --id \u003Cscenario-id>                    # full XAML\u002FC# + prerequisite notes\nwinapp find-ui --id \u003Cid-1> --id \u003Cid-2> --json        # batch, structured output\nwinapp find-ui --list                                # browse all default-source scenarios\nwinapp find-ui \"\u003Cfeature>\" --refresh                 # force a corpus refresh\n```\n\nDefault search covers the WinUI Gallery, Windows Community Toolkit, and curated core patterns. Reactor's C#-only\u002FMVU samples are opt-in with `--source reactor`; use them only for Reactor projects. The Gallery\u002FToolkit\u002FReactor corpus is fetched and cached by WinApp CLI, while core patterns work offline.\n\n## Verify APIs against the restored project\n\nBefore coding API assumptions, run from the **restored app project directory** so `winapp find-api` uses its exact references, not a sample's possibly newer package versions:\n```powershell\nwinapp find-api InfoBar --json --project-dir .\nwinapp find-api check-property InfoBar Severity IsOpen Message Title --json --project-dir .\nwinapp find-api members NavigationView --filter selected --json --project-dir .\n```\nUse **either** `--project-dir \u003Capp-directory>` (defaults to cwd) **or** `--project \u003Cname>` to select among multiple projects, never both. An unscoped query from a repo root or sibling project may target the wrong API surface. `--project sdk` searches only the installed machine SDK, not the app's NuGet references. If results look stale, check restore\u002Fproject selection before refreshing. Use `winapp find-api --help` for discovery\u002Findex commands rather than guessing an API from memory; use `find-ui` for the usage pattern.\n\n## App-shape anchors\n\nPick the closest shipping app silhouette before laying out a page:\n\n| App type | Anchor controls | Reference apps |\n|----------|-----------------|----------------|\n| Settings \u002F config tool | `NavigationView` Left + `SettingsCard` \u002F `SettingsExpander` | Windows Settings, Slack |\n| Document \u002F session editor | `TabView` + full-bleed content, light chrome | Windows Terminal, VS Code, Notepad |\n| Hierarchical browser | `TreeView` + `ListView` + `BreadcrumbBar` | File Explorer, Outlook |\n| Developer tool \u002F dashboard | `NavigationView` + card layout | Dev Home, GitHub Desktop |\n| Single-purpose utility | Mode switcher + compact grid | Calculator, Snipping Tool |\n| Media \u002F canvas \u002F hero | `Grid` with hero surface, floating commands, **no** `NavigationView` | Photos, Spotify, Clipchamp |\n\n## Reach-for-this control map\n\nBefore writing XAML, map the requirement to a platform control. These mappings exist to short-circuit cross-framework instincts (WPF `DataGrid`, web `\u003Cselect>`, HTML `\u003Cinput type=date>`):\n\n- **Navigation:** 2–7 sections → `NavigationView`; document\u002Fsession tabs → `TabView`; breadcrumb trail → `BreadcrumbBar`; 2–3 modes → `SelectorBar`.\n- **Data display:** Vertical list → `ListView`; tiles\u002Fgrid → `GridView` or `ItemsRepeater` + `UniformGridLayout`; hierarchy → `TreeView`; **tabular → `ListView` with a `Grid`-based `ItemTemplate` and a header `Grid` above** (WinUI has no `DataGrid`; don't default to `CommunityToolkit.WinUI.Controls.DataGrid` — its columns can't use `x:Bind`); master-detail → `ListView` + detail `Grid`.\n- **Input:** Text → `TextBox`; number → `NumberBox`; search → `AutoSuggestBox`; date → `CalendarDatePicker`; boolean → `ToggleSwitch`; pick one from 2–3 → `RadioButtons`; pick one from 4+ → `ComboBox`.\n- **Feedback:** Blocking decision → `ContentDialog`; contextual action → `Flyout` \u002F `MenuFlyout`; onboarding \u002F hint → `TeachingTip`; inline status \u002F async progress → `InfoBar`; system notification → `AppNotification`.\n\nIf the mapping above doesn't fit, run `winapp find-ui \"\u003Cintent>\"` before improvising.\n\n## Window sizing (WinUI 3 specifics)\n\n> **WinUI 3 has no `SizeToContent`.** Without an explicit size, Windows defaults the main window to ~1024×768 — oversized for most utilities. Size it in `MainWindow`'s constructor.\n\n**Rubric.** Width = widest row + 48 padding, rounded up to nearest 20. Height = 32 (titlebar) + Σ(row heights) + Σ(spacing) + 48 padding, rounded up to 20. Round up — clipped content is a worse failure than a slightly-wide window. Sanity ranges (derive yours from the rubric):\n\n- Single-purpose utility → ~440–560 wide\n- Form \u002F single-page tool → ~600–800 wide, ~640–800 tall\n- Multi-pane (nav + content) → ~1100–1300 wide, ~720–840 tall\n- Document \u002F canvas \u002F media editor → 1280+ wide\n\n`AppWindow.Resize` takes **physical pixels**, not DIPs — multiply by the monitor's DPI scale. `XamlRoot.RasterizationScale` is null in the constructor and stale after `AppWindow.Move`, so `[DllImport] GetDpiForWindow` is the cleanest path:\n\n```csharp\nusing Microsoft.UI;\nusing Microsoft.UI.Windowing;\nusing System.Runtime.InteropServices;\nusing Windows.Graphics;\n\npublic sealed partial class MainWindow : Window\n{\n    [DllImport(\"user32.dll\")]\n    private static extern uint GetDpiForWindow(IntPtr hWnd);\n\n    public MainWindow()\n    {\n        InitializeComponent();\n        var hwnd  = Win32Interop.GetWindowFromWindowId(AppWindow.Id);\n        var scale = GetDpiForWindow(hwnd) \u002F 96.0;\n        \u002F\u002F widthDip \u002F heightDip come from the rubric above — derive, don't copy.\n        AppWindow.Resize(new SizeInt32((int)(widthDip * scale), (int)(heightDip * scale)));\n    }\n}\n```\n\nDon't size the window by setting `Width`\u002F`Height` on the root `Grid` — that clips content, not the window.\n\n## XAML landmines (the things you'll otherwise ship broken)\n\n### Check the effective `x:Bind` mode\n\n`x:Bind` defaults to `OneTime` **unless an inherited `x:DefaultBindMode` changes it**. Use `OneWay`\u002F`TwoWay` plus change notifications for dynamic data; explicit `Mode` overrides the inherited default. Stable command\u002Fevent bindings need no blanket mode rewrite.\n\n```xml\n\u003C!-- Without an inherited default, this is OneTime -->\n\u003CTextBlock Text=\"{x:Bind Vm.Status}\" \u002F>\n\u003C!-- Updates when Vm raises the relevant change notifications -->\n\u003CTextBlock Text=\"{x:Bind Vm.Status, Mode=OneWay}\" \u002F>\n```\n\nIn a page\u002Fwindow, `x:Bind` resolves against code-behind (e.g., its `Vm` property), not `DataContext`. Use `x:DataType` on typed **DataTemplates**, not on `Page` to set a VM. Runtime `{Binding}`\u002F`DisplayMemberPath` can be appropriate; for AOT, their source classes may need `partial` plus `[WinRT.GeneratedBindableCustomProperty]`. See `winui-packaging`'s `references\u002Fsourcegen-patterns.md` instead of treating all runtime binding as unsupported.\n\n### `TextBox` two-way needs `UpdateSourceTrigger=PropertyChanged`\n\n```xml\n\u003CTextBox Text=\"{x:Bind Vm.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\" \u002F>\n```\n\nDefault trigger resolves to `LostFocus` specifically for `TextBox.Text` (most other properties default to `PropertyChanged`). The VM is not updated per keystroke, and UIA keyboard-simulation tests (WinAppDriver `SendKeys`, etc.) that assert immediately after typing will see stale VM state until focus moves.\n\n### Attached properties from C# use static setters, not initializers\n\n```csharp\nusing Microsoft.UI.Xaml.Automation;\n\n\u002F\u002F ❌ WRONG — does not compile. CS0117: 'Button' does not contain a definition for 'AutomationProperties'.\n\u002F\u002F AutomationProperties is a static class of attached-property accessors, not an instance member.\nvar btn = new Button { AutomationProperties = { AutomationId = \"BtnSave\" } };\n\n\u002F\u002F ✅ CORRECT\nvar btn = new Button { Content = \"Save\" };\nAutomationProperties.SetAutomationId(btn, \"BtnSave\");\nAutomationProperties.SetName(btn, \"Save button\");\nGrid.SetRow(btn, 1);\nToolTipService.SetToolTip(btn, \"Save the current document\");\n```\n\n### `Converter={x:Null}` crashes `x:Bind` at runtime\n\n`{x:Bind}` requires `Converter` to be a `{StaticResource}` lookup. `Converter={x:Null}` compiles but the generated code calls `LookupConverter(\"\")`, which returns null, then dereferences it — you get `Resource Dictionary Key can only be String-typed` \u002F `NullReferenceException` on first activation of the binding. If you don't want a converter, omit the property entirely.\n\n### Prefer `x:Bind` static functions over `IValueConverter`\n\n```csharp\n\u002F\u002F MainPage.xaml.cs\npublic static Visibility BoolToVisibility(bool v) => v ? Visibility.Visible : Visibility.Collapsed;\npublic static Visibility InvertBoolToVisibility(bool v) => v ? Visibility.Collapsed : Visibility.Visible;\npublic static bool Not(bool v) => !v;\n```\n```xml\n\u003CTextBlock Visibility=\"{x:Bind local:MainPage.BoolToVisibility(Vm.IsLoading), Mode=OneWay}\" \u002F>\n\u003CButton   IsEnabled=\"{x:Bind local:MainPage.Not(Vm.IsLoading), Mode=OneWay}\" \u002F>\n```\n\n### Acrylic and `ThemeShadow` rendering rules\n\n- `BackgroundSizing` defaults to `InnerBorderEdge` on both `Border` and `Control`, which correctly clips acrylic to the inner stroke. The hazard is the opposite of intuition: don't *change* it to `OuterBorderEdge` on a bordered acrylic surface — that's what makes the material bleed past the stroke.\n- `ThemeShadow` casts a shadow from the caster's `Translation` Z. Microsoft's recommended elevations are `16` for tooltips, `32` for popup\u002Fflyout UI, `128` for dialogs — pick by surface type. For non-popup casters, add the surfaces it should land on to `ThemeShadow.Receivers`; otherwise the shadow has nothing to fall on and looks clipped.\n\n## Theming rules (short version)\n\n- `{ThemeResource ...}` at usage sites (updates on theme switch). `{StaticResource}` inside `ThemeDictionaries` for theme-local definitions; `SystemAccentColor` \u002F `SystemColor*` are the exceptions and stay `{ThemeResource}`.\n- Custom theme dictionaries cover `Light`, `Dark`, **and** `HighContrast` explicitly — never `Default`.\n- Name resources by purpose (`CardBackgroundBrush`, `DangerTextBrush`), not hue.\n- Light\u002FDark working ≠ High Contrast working. Test in a Contrast theme separately.\n- Never set `HighContrastAdjustment=\"None\"` unless your app already supplies system-aware brushes throughout.\n\n## Anti-patterns\n\n| ❌ Don't | ✅ Do instead |\n|---------|--------------|\n| Reflexively build every app as `NavigationView` Left | Pick the closest row in the silhouette table; hero \u002F document \u002F utility shapes are equally valid |\n| Treat brand colour or tinted backdrop as off-pattern | Overriding `SystemAccentColor` or using a tinted `DesktopAcrylicBackdrop` is how Microsoft's own first-party apps differentiate |\n| Tiny content island on an oversized window | Either size the window to the content (see *Window sizing*) or let content fill the available space |\n| Custom pill \u002F segmented tab switcher built by hand | `NavigationView` Top or `SelectorBar` |\n| Equal-width 50\u002F50 column split where one pane is structural | Stable size for the structural pane, flexible for content — only if a structural pane is part of the silhouette at all |\n| Hard-coded color literals (`#RRGGBB`, `White`) | `{ThemeResource}` brushes by semantic name |\n| `ScrollViewer` wrapped around a `ListView` \u002F `GridView` | The collection control already scrolls — give it a constrained height |\n| Custom `ControlTemplate` for a standard control | Built-in control + lightweight style overrides |\n| Placeholder text used as the only field label | Always provide a visible label |\n| Required commands hidden at small widths with no route | Overflow menu, secondary surface, or a responsive promotion rule |\n| Modal `ContentDialog` for non-blocking hints | `TeachingTip`, `InfoBar`, or inline status |\n| Destructive action (Delete \u002F Discard \u002F Reset) fired without confirmation | `ContentDialog` with verb-labelled primary action and `Cancel` secondary; surface item identity (name, count) in the body |\n| Custom list control when `ListView` \u002F `GridView` fits | Use the platform collection + virtualisation |\n\nBuild custom UI **only when all are true**: no platform\u002FGallery\u002FToolkit control fits; you'll implement keyboard, focus, UI Automation, theme resources, High Contrast, and responsive behaviour; you have specs for default\u002Fhover\u002Fpressed\u002Fdisabled\u002Fselected\u002Ffocused\u002Ferror states; you've tested with keyboard and a contrast theme.\n\n## References (load on demand)\n\n| File | Load when… |\n|------|-----------|\n| `references\u002Fbrushes-and-icons.md` | Looking up a brush key by purpose, picking between `Icon` \u002F `IconSource` slots, choosing among `FontIcon` \u002F `SymbolIcon` \u002F `PathIcon` \u002F etc. |\n| `references\u002Ftheme-accessibility.md` | Authoring theme dictionaries, custom brushes\u002Fstyles\u002Ftemplates, or High Contrast support. |\n| `references\u002Flayout-review.md` | Reviewing responsive behaviour, breakpoints, or empty\u002Floading\u002Ferror coverage on a data-driven page. |\n",{"name":5,"description":7},"main","1fe910277860e8dbb38bfbeef7e8bdb039d6ee41","plugins\u002Fwinui\u002Fagent-plugin\u002Fskills\u002Fwinui-design",96,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FwinappCli","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-14 07:14:37",{"source":9,"skillName":5,"commands":68,"prompt":78,"zipAvailable":79},[69,72,75],{"tool":70,"command":71},"npx","npx skills add microsoft\u002FwinappCli --skill winui-design",{"tool":73,"command":74},"bunx","bunx skills add microsoft\u002FwinappCli --skill winui-design",{"tool":76,"command":77},"pnpm","pnpm dlx skills add microsoft\u002FwinappCli --skill winui-design","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FwinappCli\u002Fblob\u002Fmain\u002Fplugins\u002Fwinui\u002Fagent-plugin\u002Fskills\u002Fwinui-design\u002FSKILL.md",true,[81,87,91],{"path":82,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fbrushes-and-icons.md","REFERENCE","参考文档",12088,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FwinappCli\u002Fblob\u002Fmain\u002Fplugins\u002Fwinui\u002Fagent-plugin\u002Fskills\u002Fwinui-design\u002Freferences\u002Fbrushes-and-icons.md",{"path":88,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Flayout-review.md",2104,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FwinappCli\u002Fblob\u002Fmain\u002Fplugins\u002Fwinui\u002Fagent-plugin\u002Fskills\u002Fwinui-design\u002Freferences\u002Flayout-review.md",{"path":92,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Ftheme-accessibility.md",3082,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FwinappCli\u002Fblob\u002Fmain\u002Fplugins\u002Fwinui\u002Fagent-plugin\u002Fskills\u002Fwinui-design\u002Freferences\u002Ftheme-accessibility.md",[96,123,153,180,203,222],{"skillNo":97,"name":98,"nameZh":99,"description":100,"descriptionZh":101,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":102,"categories":103,"keywords":108,"publishedAt":53},"01M699M75MK9AADQV8PQQQ6NEV","winui-wpf-migration","WPF 至 WinUI 3 应用迁移","Migrate or port a WPF app to WinUI 3: namespaces (System.Windows to Microsoft.UI.Xaml), control mapping (DataGrid, WrapPanel, TabControl), Dispatcher to DispatcherQueue, imaging, MVVM with CommunityToolkit.Mvvm, ThemeResource. Use when converting WPF code or fixing migration build errors.","将 WPF 应用迁移或移植到 WinUI 3：命名空间（System.Windows 到 Microsoft.UI.Xaml）、控件映射（DataGrid、WrapPanel、TabControl）、Dispatcher 到 DispatcherQueue、图像处理、使用 CommunityToolkit.Mvvm 的 MVVM、ThemeResource。在转换 WPF 代码或修复迁移构建错误时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FwinappCli\u002Fblob\u002Fmain\u002Fplugins\u002Fwinui\u002Fagent-plugin\u002Fskills\u002Fwinui-wpf-migration\u002FSKILL.md",[104,105],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":106,"categoryName":107,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BT7QVANT4709358VEJK53E","代码实现",[109,32,46,110,10,48,111,112,45,34,113,114,115,116,39,117,118,119,120,121,122],"winui wpf migration","migration","dispatcher","code","migrate","system","use","mvvm","mapping","port","imaging","errors","namespaces","when",{"skillNo":124,"name":125,"nameZh":126,"description":127,"descriptionZh":128,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":129,"categories":130,"keywords":137,"publishedAt":53},"01M699M4W3GKSVVT9CRR1E3KSW","winui-ui-testing","Windows 桌面应用 UI 自动化测试","Write and run automated UI tests for Windows desktop apps (WinUI 3, WPF, WinForms, Win32) with the winapp ui harness: one batch script, assertions, input, file pickers, dialogs, screenshots, locally or in Windows Sandbox. Use when asked for UI tests or to verify a feature end to end.","使用 winapp ui harness 为 Windows 桌面应用（WinUI 3、WPF、WinForms、Win32）编写并运行自动化 UI 测试：一个批处理脚本，支持断言、输入、文件选择器、对话框、截图，可在本地或 Windows Sandbox 中运行。当用户要求 UI 测试或端到端验证某个功能时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FwinappCli\u002Fblob\u002Fmain\u002Fplugins\u002Fwinui\u002Fagent-plugin\u002Fskills\u002Fwinui-ui-testing\u002FSKILL.md",[131,134],{"categoryNo":132,"categoryName":133,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":135,"categoryName":136,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[138,139,32,34,140,141,142,48,143,144,145,146,147,148,149,150,151,38,152,36,122],"testing","winui ui testing","ui testing","screenshots","sandbox","run","win32","harness","batch","write","feature","end","apps","input","desktop apps",{"skillNo":154,"name":155,"nameZh":156,"description":157,"descriptionZh":158,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":159,"categories":160,"keywords":165,"publishedAt":53},"01M699M2KTEYJZBDW7JBHM94K0","winui-setup","WinUI 3 开发环境配置","Install and verify WinUI 3 prerequisites — .NET SDK 8.0.100+, WinApp CLI 0.7+, and Developer Mode; identify additional Native AOT and Windows Sandbox requirements. Use when the user asks to set up or repair the toolchain, or when another WinUI skill finds a missing or outdated prerequisite.","安装并验证 WinUI 3 的先决条件——.NET SDK 8.0.100+、WinApp CLI 0.7+ 以及开发者模式；识别 Native AOT 和 Windows Sandbox 的额外要求。当用户请求设置或修复工具链，或其他 WinUI 技能发现先决条件缺失或过时时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FwinappCli\u002Fblob\u002Fmain\u002Fplugins\u002Fwinui\u002Fagent-plugin\u002Fskills\u002Fwinui-setup\u002FSKILL.md",[161,162],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":163,"categoryName":164,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSTR9G4A4GZ0VB2DFN9490","开发环境与工具链管理",[166,167,32,168,142,51,48,169,170,171,115,172,173,174,175,176,177,178,179,122],"winui setup","setup","cli","SET","verify","install","up","repair","requirements","missing","native","toolchain","winapp cli","mode",{"skillNo":181,"name":182,"nameZh":183,"description":184,"descriptionZh":185,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":186,"categories":187,"keywords":192,"publishedAt":53},"01M699KZWEZ84A4J3291E6R65B","winui-packaging","WinUI 3 应用打包与发布","MSIX packaging, signing, and Microsoft Store publishing for WinUI 3 apps with WinApp CLI 0.7+: project packaging, Native AOT, certificates, self-contained deployment, CI\u002FCD. Use when releasing or publishing a WinUI app. Not for WPF, WinForms, or Electron apps that only reference the Windows App SDK.","使用 WinApp CLI 0.7+ 对 WinUI 3 应用进行 MSIX 打包、签名并发布到 Microsoft Store：包括项目打包、Native AOT、证书、自包含部署和 CI\u002FCD。在发布 WinUI 应用时使用。不适用于仅引用 Windows App SDK 的 WPF、WinForms 或 Electron 应用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FwinappCli\u002Fblob\u002Fmain\u002Fplugins\u002Fwinui\u002Fagent-plugin\u002Fskills\u002Fwinui-packaging\u002FSKILL.md",[188,189],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":190,"categoryName":191,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQNXPY1AV6BSR5VKHDMWRH","部署与发布管理",[193,32,194,168,51,195,10,196,48,47,197,198,199,200,201,39,150,38,176,202,178,36,122],"winui packaging","packaging","electron","msix","ci","certificates","only","self","project","CI\u002FCD",{"skillNo":204,"name":205,"nameZh":206,"description":207,"descriptionZh":208,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":209,"categories":210,"keywords":213,"publishedAt":53},"01M699KXTHG9FHK4X3JSZ4SV8J","winui-dev-workflow","WinUI 应用开发工作流","Create, build, run, and fix build errors in WinUI 3 apps (C# or C++) with WinApp CLI 0.7+: winapp new, winapp run, Native AOT, crash diagnosis. Use for a new WinUI app or a WinUI project that fails to build or crashes. Not for WPF, WinForms, or Electron apps that only reference the Windows App SDK.","使用 WinApp CLI 0.7+ 创建、构建、运行 WinUI 3 应用（C# 或 C++）并修复构建错误：winapp new、winapp run、Native AOT、崩溃诊断。适用于新建 WinUI 应用，或构建失败、发生崩溃的 WinUI 项目。不适用于仅引用 Windows App SDK 的 WPF、WinForms 或 Electron 应用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FwinappCli\u002Fblob\u002Fmain\u002Fplugins\u002Fwinui\u002Fagent-plugin\u002Fskills\u002Fwinui-dev-workflow\u002FSKILL.md",[211,212],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":163,"categoryName":164,"taxonomyType":28,"taxonomyTypeDesc":29},[214,215,32,216,217,168,51,195,48,218,143,219,199,201,39,220,150,38,176,178,120,221],"workflow","winui dev workflow","dev","dev workflow","create","fix","diagnosis","new",{"skillNo":223,"name":224,"nameZh":225,"description":226,"descriptionZh":227,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":228,"categories":229,"keywords":232,"publishedAt":53},"01M699KR63WV521C7JT7FQMADN","winui-code-review","WinUI 3 代码审查","Review WinUI 3 code or changes for quality: MVVM, x:Bind correctness, accessibility, theming, security, performance, and WinUI analyzer findings. Use when asked to review or audit a WinUI app or its pending changes, or before committing. Catches issues the compiler and UI tests miss.","审查 WinUI 3 代码或变更的质量：MVVM、x:Bind 正确性、可访问性、主题、安全性、性能以及 WinUI 分析器发现的问题。当被要求审查或审计 WinUI 应用或其待提交的变更时使用，或在提交前使用。可发现编译器和 UI 测试遗漏的问题。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FwinappCli\u002Fblob\u002Fmain\u002Fplugins\u002Fwinui\u002Fagent-plugin\u002Fskills\u002Fwinui-code-review\u002FSKILL.md",[230,231],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":135,"categoryName":136,"taxonomyType":28,"taxonomyTypeDesc":29},[233,234,235,112,32,236,237,50,238,239,240,115,116,241,40,39,242,243,36,244,245,122],"code review","review","winui code review","security","performance","issues","winui app","compiler","tests","theming","correctness","changes","pending"]