WinUI 3 C# App
Overview
Build or refactor WinUI 3 apps with Windows App SDK. Focus: app structure, XAML, MVVM, bindings, navigation, threading, system backdrops. Keep behavior stable unless asked to change it.
Workflow Decision Tree
- •New app? -> follow Quick Start (New)
- •Existing app? -> follow Quick Start (Existing)
- •Need details? -> open
references/index.md, then targeted reference
Core Rules
- •Prefer Windows App SDK / WinUI APIs over custom hacks.
- •Keep code-behind thin (view glue only).
- •Prefer
x:Bindfor typed bindings; useBindingfor dynamic DataContext. - •UI thread access via
DispatcherQueue. - •System backdrops:
Window.SystemBackdropfirst; fall back if unsupported.
Quick Start (New)
- •Create WinUI 3 Blank App, Packaged.
- •Add ViewModel, implement
INotifyPropertyChanged. - •Set
DataContextand exposeViewModelproperty forx:Bind. - •Build layout with
Grid/StackPanel. - •Wire commands via
RelayCommand/AsyncRelayCommand. - •Add navigation if multi-page.
Quick Start (Existing)
- •Inspect XAML + code-behind for binding mode / DataContext mistakes.
- •Move logic to ViewModel; keep UI glue in code-behind.
- •Check threading: UI updates on UI thread only.
- •Validate system backdrop usage and fallbacks.
References
- •
project-setup.md-> create WinUI 3 project, packaging notes - •
community-toolkit.md-> Windows Community Toolkit + MVVM Toolkit usage - •
mvvm.md-> ViewModel patterns,INotifyPropertyChanged, commands - •
binding-xbind.md->x:BindvsBinding, modes, templates - •
threading.md-> UI thread,DispatcherQueue, STA vs ASTA notes - •
system-backdrop.md-> Mica/Acrylic,Window.SystemBackdrop, fallbacks - •
navigation.md-> Frame + NavigationView patterns