A comprehensive inventory of WinUI 3 / Windows App SDK features relevant to application development, organized for gap analysis against the Microsoft.UI.Reactor (Reactor) framework.
- Built-in Controls
- Layout System
- Navigation Patterns
- Data Binding
- Dependency Property System
- XAML Markup Features
- Resources and Resource Management
- Styling
- Theming
- Visual State Manager
- Animations and Transitions
- Composition Visual Layer
- Materials and Effects
- Input Handling
- Commands
- Accessibility
- Threading Model
- Windowing
- Application Lifecycle
- App Services
- Interop
- Content and Items Infrastructure
| Control | Purpose |
|---|---|
| Button | Standard push button, raises Click |
| DropDownButton | Button with chevron opening a flyout |
| SplitButton | Two-part: immediate action + flyout |
| ToggleSplitButton | Two-part with toggle side |
| HyperlinkButton | Link-styled navigation button |
| RepeatButton | Raises Click repeatedly while held |
| ToggleButton | Two-state toggle base class |
| CheckBox | Tri-state selection (checked/unchecked/indeterminate) |
| RadioButton | Mutually exclusive selection |
| RadioButtons | Grouped radio button container with keyboard nav |
| ToggleSwitch | On/off binary switch |
| Slider | Value selection from continuous range |
| ComboBox | Drop-down single selection |
| ListBox | Inline single/multi selection |
| ColorPicker | Color selection with spectrum, sliders, text input |
| RatingControl | Star-based rating input |
| NumberBox | Numeric input with validation, stepping, inline math |
Docs: Buttons | CheckBox | ComboBox | ColorPicker | NumberBox
| Control | Purpose |
|---|---|
| TextBlock | Read-only text with inline formatting (bold, italic, underline, hyperlinks) |
| RichTextBlock | Advanced read-only text with inline UI elements, multi-column overflow |
| TextBox | Single/multi-line plain text input |
| RichEditBox | Rich text editing with formatting (RTF) |
| PasswordBox | Masked secret input |
| AutoSuggestBox | Text input with suggestion dropdown |
Docs: Text controls overview | TextBox | RichEditBox
| Control | Purpose |
|---|---|
| FontIcon | Glyph from a font (default: Segoe Fluent Icons) |
| SymbolIcon | Predefined icon from Symbol enum |
| ImageIcon | Image (PNG, SVG) as icon |
| AnimatedIcon | Lottie-animated icon responding to state changes |
| BitmapIcon | Bitmap as monochrome icon |
| PathIcon | Vector path as icon |
Docs: Icons | AnimatedIcon
| Control | Purpose |
|---|---|
| ListView | Vertical list with selection, grouping, virtualization |
| GridView | Wrapping grid with virtualization |
| ItemsView | Modern collection control (replaces ListView/GridView for new code) |
| ItemsRepeater | Low-level data-driven repeater with pluggable layout and virtualization |
| FlipView | One-at-a-time with flip/swipe navigation |
| TreeView | Hierarchical expandable/collapsible nodes |
Docs: Collections and lists | ListView & GridView | ItemsView | ItemsRepeater
| Control | Purpose |
|---|---|
| CalendarView | Always-visible calendar for date/range selection |
| CalendarDatePicker | Drop-down opening a CalendarView |
| DatePicker | Spinner-style date selector (month/day/year) |
| TimePicker | Spinner-style time selector (hour/minute/AM-PM) |
Docs: Date and time
| Control | Purpose |
|---|---|
| ContentDialog | Modal dialog with up to 3 buttons |
| Flyout | Light-dismiss popup attached to an element |
| MenuFlyout | Flyout with menu items, sub-items, toggles, radio items |
| CommandBarFlyout | Rich flyout with primary/secondary commands |
| TeachingTip | Onboarding/feature-discovery notification |
| ToolTip | Supplementary info on hover/focus |
| Popup | General-purpose overlay |
Docs: Dialogs and flyouts | TeachingTip
| Control | Purpose |
|---|---|
| MenuBar | Horizontal row of top-level menus (File, Edit, View...) |
| MenuBarItem | Single top-level menu in a MenuBar |
| CommandBar | Toolbar with primary and overflow commands |
| AppBarButton | Icon+label button for CommandBar |
| AppBarToggleButton | Toggle button for CommandBar |
| AppBarSeparator | Visual separator in CommandBar |
Docs: MenuBar | CommandBar
| Control | Purpose |
|---|---|
| NavigationView | App-level nav with hamburger menu; left-nav, top-nav, compact modes |
| TabView | Browser-style tabs with reorder, add, close |
| BreadcrumbBar | Path-based navigation with overflow ellipsis |
| SelectorBar | Tab-like view switcher within a page |
| Pivot | Deprecated tabbed navigation |
| Frame | Hosts Pages, manages back-stack |
| Page | Content container for Frame navigation |
| PipsPager | Dot-based page indicator |
Docs: NavigationView | TabView | BreadcrumbBar | Page navigation
| Control | Purpose |
|---|---|
| Image | Displays raster/vector images (PNG, JPG, SVG, GIF) |
| MediaPlayerElement | Audio/video playback with transport controls |
| InkCanvas | Freehand pen/touch inking surface |
| InkToolbar | Toolbar for InkCanvas (pen, pencil, highlighter, eraser, ruler) |
| WebView2 | Embedded Chromium browser (Edge) |
| PersonPicture | Avatar image or initials |
| ParallaxView | Parallax scrolling tied to ScrollViewer offset |
| CaptureElement | Camera preview stream |
| MapControl | Map visualization (with MapElement, MapIcon, MapLayer) |
| AnimatedVisualPlayer | Lottie animation playback |
Docs: MediaPlayerElement | WebView2
| Control | Purpose |
|---|---|
| ProgressBar | Determinate/indeterminate horizontal progress |
| ProgressRing | Circular progress indicator |
| InfoBar | Inline non-blocking notification (success/warning/error/info) |
| InfoBadge | Small badge overlay (dot, number, or icon) |
| Expander | Collapsible header/content |
Docs: Progress controls | InfoBar | InfoBadge
| Control | Purpose |
|---|---|
| ScrollViewer | Classic scroll container with pan and zoom |
| ScrollView | Modern scroll control based on InteractionTracker |
| AnnotatedScrollBar | Scrollbar with labeled section annotations |
| ScrollBar | Standalone scrollbar primitive |
Docs: Scroll controls
| Control | Purpose |
|---|---|
| Border | Border/background around a single child |
| Viewbox | Scales single child to fill available space |
| SplitView | Collapsible pane + content region |
| TwoPaneView | Adaptive dual-pane (side-by-side or top-bottom) |
| SwipeControl | Swipe gestures revealing contextual commands |
| RefreshContainer | Pull-to-refresh interaction wrapper |
Docs: SplitView | TwoPaneView
| Control | Purpose |
|---|---|
| TitleBar | Custom window title bar control |
Source: microsoft-ui-xaml-lift/controls/dev/TitleBar/
| Panel | Behavior |
|---|---|
| Grid | Row/column grid with star, auto, and pixel sizing |
| StackPanel | Stacks children vertically (default) or horizontally; supports Spacing |
| Canvas | Absolute positioning via Canvas.Left/Top attached properties |
| RelativePanel | Children positioned relative to each other or panel edges |
| VariableSizedWrapGrid | Wrapping grid where items can span multiple rows/columns |
Docs: Layout panels
The XAML layout engine uses a recursive two-pass algorithm:
-
Measure pass --
UIElement.Measure(availableSize)called on each element. Each element computes how much space it needs and sets itsDesiredSize. Panels call Measure on each child from theirMeasureOverride. -
Arrange pass --
UIElement.Arrange(finalRect)assigns each element its actual position and size. Panels call Arrange on each child from theirArrangeOverride.
Key rules:
- Property changes affecting size trigger
InvalidateMeasure(new Measure+Arrange cycle) - Property changes affecting only position trigger
InvalidateArrange - Custom panels subclass
Paneland overrideMeasureOverride/ArrangeOverride
Docs: Custom panels
The Layout abstract class provides "attached layouts" used by ItemsRepeater with
NonVirtualizingLayout and VirtualizingLayout subclasses.
Built-in attached layouts:
- StackLayout -- linear stack
- UniformGridLayout -- uniform grid with item justification
- FlowLayout -- flowing wrapping layout
- LinedFlowLayout -- advanced flowing layout with line management and aspect-ratio sizing
Custom virtualizing layouts subclass VirtualizingLayout and implement MeasureOverride/
ArrangeOverride with a VirtualizingLayoutContext.
Docs: Attached layouts
| Feature | Description |
|---|---|
| AdaptiveTrigger | Fires on MinWindowWidth/MinWindowHeight thresholds in VisualStateManager |
| Custom StateTriggers | Extend StateTriggerBase for any condition (device, orientation, etc.) |
| NavigationView auto-mode | CompactModeThresholdWidth/ExpandedModeThresholdWidth auto-switch |
| RelativePanel | Rearrange children via visual states without changing panel |
| TwoPaneView | Automatic side-by-side / top-bottom based on space and dual-screen hinge |
Docs: Responsive layouts
Primary pattern: NavigationView as root with a Frame as Content. Each destination is a Page
loaded into the Frame.
| Component | Role |
|---|---|
| NavigationView | Nav menu (left/top/compact), header, back button, settings, content region |
| Frame | Hosts Pages, maintains back-stack. Navigate(typeof(Page)), GoBack(), GoForward() |
| Page | ContentControl subclass for navigation content |
| TabView | Document/multi-tab scenarios with drag-reorder, add, close |
| BreadcrumbBar | Hierarchical path with overflow ellipsis |
| SelectorBar | Horizontal labeled items for in-page view switching |
NavigationView features (from source):
- NavigationViewDisplayMode: Minimal, Compact, Expanded
- NavigationViewPaneDisplayMode: Auto, Left, Top, LeftCompact, LeftMinimal
- NavigationViewBackButtonVisible: back button visibility
- NavigationViewSelectionFollowsFocus: keyboard/focus navigation modes
- NavigationViewShoulderNavigationEnabled: gamepad shoulder button support
Docs: NavigationView | Navigate between pages
| Aspect | {x:Bind} (compiled) | {Binding} (runtime) |
|---|---|---|
| Default mode | OneTime | OneWay |
| Resolution | Compile-time against code-behind | Runtime via DataContext |
| Source | Page/UserControl itself | DataContext (inherited) |
| Type safety | Compile-time validated | Runtime; can bind to Object |
| DataTemplate | Requires x:DataType |
Uses inherited DataContext |
| Event binding | Supported | Not supported |
| Function binding | Supported (leaf step can be a function) | Not supported |
| Programmatic creation | Not possible | Supported via Binding class |
| Target requirement | Any property | Must be a DependencyProperty |
- OneTime -- reads source once at initialization
- OneWay -- source-to-target, updates on change notification
- TwoWay -- bidirectional;
UpdateSourceTriggercontrols when (defaultPropertyChanged,LostFocusfor TextBox.Text)
x:DefaultBindMode attribute changes the default for {x:Bind} on an element and descendants.
- INotifyPropertyChanged -- fires
PropertyChangedevent for single-property updates - INotifyCollectionChanged -- fires
CollectionChangedfor Add/Remove/Replace/Move/Reset - ObservableCollection<T> -- implements both; does NOT monitor property changes on items
Convert (source-to-target) and ConvertBack (target-to-source). Declared as XAML resource.
Built-in: bool to Visibility is automatic (SDK 14393+).
Additional properties: FallbackValue, TargetNullValue, ConverterParameter, ConverterLanguage.
<TextBlock Text="{x:Bind local:MyHelpers.Half(BigTextBlock.FontSize)}" />- Functions as leaf step of binding path
- Two-way via
BindBackproperty - Change detection: re-evaluates when any parameter source fires PropertyChanged
- Arguments: binding paths, quoted strings, numbers,
x:True/x:False - System functions:
sys:String.Format(...),sys:DateTime.Parse(...)
Pages/UserControls with {x:Bind} get a Bindings property:
Update()-- re-evaluates all compiled bindingsInitialize()-- calls Update if not initializedStopTracking()-- unhooks all OneWay/TwoWay listeners
Docs: Data binding in depth | {x:Bind} | Function bindings | Data binding and MVVM
DependencyObject provides the global internal property store. DependencyProperty is the
identifier (static token). Properties stored in centralized store, not as class fields.
Features enabled: data binding, styles, storyboarded animations, property-changed callbacks,
metadata-based defaults, ClearValue.
public static readonly DependencyProperty LabelProperty = DependencyProperty.Register(
nameof(Label), typeof(string), typeof(MyControl),
new PropertyMetadata(null, new PropertyChangedCallback(OnLabelChanged)));Critical: Property wrappers must only call GetValue/SetValue. XAML parser bypasses wrappers.
- Default value (object) and/or
PropertyChangedCallback PropertyMetadata.CreatewithCreateDefaultValueCallbackfor thread-safe reference-type defaults- Never pass instantiated reference-type as default (shared across instances)
- Must be static
- Receives
DependencyObject dandDependencyPropertyChangedEventArgs e - Can reject values by setting back to OldValue
RegisterPropertyChangedCallback registers for changes on any DP of a specific instance (even
built-in properties).
- Active animations (including HoldEnd)
- Local value (SetValue, XAML, bindings, resource references)
- Templated properties (from ControlTemplate/DataTemplate)
- Style setters
- Default value (from PropertyMetadata)
DependencyProperty.RegisterAttached with static Get/Set accessors. Owning class does NOT
need to derive from DependencyObject.
- No built-in
CoerceValueCallback(implement manually in PropertyChangedCallback) - No read-only dependency properties (
DependencyPropertyKey) - All DependencyObject access requires UI thread
Docs: Dependency properties | Custom dependency properties | Attached properties
| Extension | Purpose |
|---|---|
{x:Bind} |
Compiled data binding |
{Binding} |
Runtime data binding |
{StaticResource} |
One-time keyed resource lookup |
{ThemeResource} |
Theme-aware resource lookup (re-evaluates on theme change) |
{TemplateBinding} |
Bind within ControlTemplate to templated parent property |
{x:Null} |
Null value |
{CustomResource} |
For CustomXamlResourceLoader |
Custom markup extensions: derive from MarkupExtension and override ProvideValue.
| Attribute | Purpose |
|---|---|
x:Name |
Generates code-behind field; used in {x:Bind} paths |
x:Key |
Resource dictionary key |
x:Class |
Code-behind partial class for page/control |
x:DataType |
Required on DataTemplate for {x:Bind} |
x:DefaultBindMode |
Default binding mode (OneTime/OneWay/TwoWay) for subtree |
- x:DeferLoadStrategy="Lazy" -- element not created until realized
- x:Load (supersedes above) -- supports unloading too (
x:Load="False") - Realize via:
FindName(),GetTemplateChild(), VisualState targeting, binding targeting - ~600 bytes overhead per deferred element
API contract checks in namespace declarations for conditional element inclusion:
xmlns:contract7="...?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"{x:Bind ((TextBox)obj).Text}Docs: x:DeferLoadStrategy | Conditional XAML
Keyed collection of shareable objects. Every FrameworkElement has a Resources property. Common
types: Style, ControlTemplate, DataTemplate, Brush, Color, Thickness, CornerRadius, converters.
Not shareable: UIElement subclasses (can only exist once in visual tree).
FrameworkElement.Resourcesof the element itself- Walk up visual tree checking each parent's Resources
Application.Resources(app-level)- Theme dictionaries (from control templates)
- Platform/system resources (generic.xaml, themeresources.xaml)
Code-based Resources["key"] does NOT walk up -- only searches that specific dictionary.
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Dictionary1.xaml"/>
<ResourceDictionary Source="Dictionary2.xaml"/>
</ResourceDictionary.MergedDictionaries>Lookup: primary first, then merged in reverse order (last-added wins).
Keys: "Default", "Dark", "Light", "HighContrast". Active dictionary switches on theme
change. Only effective via {ThemeResource}.
WinUI controls library dictionary. Add to Application.Resources first so custom styles
override it.
Resources must be defined lexically before references. No forward references supported.
Docs: ResourceDictionary and XAML resources
A Style has a TargetType and Setter elements. Two kinds:
- Implicit (no x:Key) -- auto-applied to all matching controls in scope
- Explicit (has x:Key) -- must be explicitly referenced
<Style x:Key="DerivedStyle" TargetType="Button" BasedOn="{StaticResource BasicStyle}">Derived TargetType must be same type or subclass.
Override specific theme resource keys per-control without re-templating. Each control exposes named brush resources with state suffixes:
<CheckBox.Resources>
<SolidColorBrush x:Key="CheckBoxForegroundUnchecked" Color="Purple"/>
</CheckBox.Resources>State suffix pattern: {ControlName}{Property}{State} (e.g., ButtonBackgroundPointerOver).
Defines the complete visual tree for a control. Includes VisualStateManager groups, template parts (named elements via x:Name), and ContentPresenter.
Visual structure for data items in ListView, GridView, ContentPresenter. With x:DataType for
compiled bindings.
Custom templated controls require a Generic.xaml file in a Themes folder (required naming
convention).
Docs: XAML styles | Templated controls
Three themes: Light, Dark, HighContrast.
- Set
Application.RequestedThemein App.xaml (Light/Dark/omit for system) - Per-element override:
FrameworkElement.RequestedTheme = ElementTheme.Light - High contrast overrides
RequestedThemewhen active
{ThemeResource}-- re-evaluated on theme change{StaticResource}-- evaluated once at load time
Inside ThemeDictionaries, use {StaticResource} except for SystemColor* in HighContrast
(those need {ThemeResource}).
System accent: SystemAccentColor with light/dark shades (SystemAccentColorLight1 through
Light3, Dark1 through Dark3).
Override app-wide:
<Color x:Key="SystemAccentColor">#107C10</Color>Uses SystemColor* prefixed resources (e.g., SystemColorWindowTextColor). Custom controls MUST
provide a HighContrast theme dictionary and use these system resources.
Detection (SDK 1.6+):
var settings = new Microsoft.UI.System.ThemeSettings();
bool isHighContrast = settings.HighContrast;Docs: Theming | XAML theme resources | Contrast themes | Color
- VisualStateManager -- manages transitions between visual states
- VisualStateGroup -- contains mutually exclusive VisualState objects
- VisualState -- one discrete visual configuration (Setters and/or Storyboard)
A control can have multiple groups (e.g., "CommonStates", "FocusStates", "CheckStates").
- Setters -- discrete instant property changes
- Storyboard -- animated property changes over time
- Both can coexist in the same VisualState
VisualStateManager.GoToState(myControl, "PointerOver", useTransitions: true);| Trigger | Purpose |
|---|---|
| AdaptiveTrigger | Fires on MinWindowWidth/MinWindowHeight |
| StateTrigger | Simple boolean IsActive binding |
| Custom triggers | Extend StateTriggerBase, call SetActive(bool) |
Animated transitions between states within a group:
<VisualTransition From="Normal" To="PointerOver" GeneratedDuration="0:0:0.25"/>Docs: VisualState | AdaptiveTrigger
- Theme Transitions -- automatic, declarative via
Transitionsproperty - Theme Animations -- pre-configured, inside Storyboards
- Storyboarded Animations -- custom From/To/By or keyframe
- Connected Animations -- cross-view continuity
- Composition Animations -- visual-layer (KeyFrame, Expression, Spring, Implicit)
Applied via UIElement.Transitions or ItemsControl.ItemContainerTransitions:
| Transition | Purpose |
|---|---|
EntranceThemeTransition |
Element first appearing |
ContentThemeTransition |
Content changing in container |
RepositionThemeTransition |
Element changing position |
AddDeleteThemeTransition |
Items added/removed from list |
ReorderThemeTransition |
Items reordered |
PopupThemeTransition |
Popup appearing |
EdgeUIThemeTransition |
Small edge UI sliding in |
PaneThemeTransition |
Large pane sliding in |
NavigationThemeTransition |
Page navigation in Frame |
| Animation | Purpose |
|---|---|
FadeInThemeAnimation / FadeOutThemeAnimation |
Opacity |
PopInThemeAnimation / PopOutThemeAnimation |
Popup scale + opacity |
PointerDownThemeAnimation / PointerUpThemeAnimation |
Press feedback |
RepositionThemeAnimation |
Reposition |
DragItemThemeAnimation / DragOverThemeAnimation |
Drag and drop |
SplitOpenThemeAnimation / SplitCloseThemeAnimation |
ComboBox open/close |
DrillInThemeAnimation / DrillOutThemeAnimation |
Navigation drill |
Animate dependency properties: Double, Point, Color, Object (discrete).
<Storyboard>
<DoubleAnimation Storyboard.TargetName="MyRect" Storyboard.TargetProperty="Opacity"
From="1.0" To="0.0" Duration="0:0:1"/>
</Storyboard>Key properties: From, To, By, Duration, AutoReverse, RepeatBehavior, BeginTime,
FillBehavior, SpeedRatio.
Independent vs Dependent: Animations on Opacity, RenderTransform, Projection, Clip,
Canvas.Left/Top, SolidColorBrush.Color run on composition thread (independent). All others are
dependent, require EnableDependentAnimation = true, and block the UI thread.
Easing functions: EasingDoubleKeyFrame, SplineDoubleKeyFrame, built-in easing types
(CubicEase, QuadraticEase, BounceEase, etc.).
ObjectAnimationUsingKeyFrames for discrete (non-interpolatable) values like Visibility.
Animate an element "continuing" between views during navigation.
- Prepare on source:
ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("key", element) - Start on destination:
animation.TryStart(destElement) - Coordinated:
animation.TryStart(mainElement, new[] { otherElements }) - Configurations: GravityConnectedAnimationConfiguration (forward), DirectConnected (back), BasicConnected
ListView/GridView helpers: PrepareConnectedAnimation(), TryStartConnectedAnimationAsync().
- ItemCollectionTransition -- base collection transition
- ItemCollectionTransitionProvider -- provides transitions for collection changes
- LinedFlowLayoutItemCollectionTransitionProvider -- specialized for LinedFlowLayout
- Trigger types: Add, Remove, Reset, LayoutTransition
Docs: Animations overview | Storyboarded animations | Connected animation
Microsoft.UI.Composition provides a retained-mode graphics API running at 60 FPS on an
independent thread.
- Visual -- lightweight, thread-agile base
- ContainerVisual -- can have children
- SpriteVisual -- painted with brushes, colors, or effects
var visual = ElementCompositionPreview.GetElementVisual(myElement);
var compositor = visual.Compositor;
// or without element:
var compositor = CompositionTarget.GetCompositorForCurrentThread();KeyFrameAnimation: ScalarKeyFrame, Vector2/3/4, Color, Quaternion.
ExpressionAnimation: mathematical relationships between properties.
var expr = compositor.CreateExpressionAnimation("target.Offset.X + 100");ImplicitAnimations: fire automatically when a property changes.
implicitAnimations["Offset"] = offsetAnimation;
visual.ImplicitAnimations = implicitAnimations;NaturalMotionAnimations (Springs):
var spring = compositor.CreateSpringVector3Animation();
spring.DampingRatio = 0.6f;
spring.Period = TimeSpan.FromMilliseconds(50);InteractionTracker: input-driven animations for smooth scrolling, pull-to-refresh, etc.
Hosts DirectX swap chains within XAML. Limitations:
- External content (below compositor surface)
- No transparency, no AcrylicBrush/CompositionBackdropBrush over it
- Same limitations for MediaPlayerElement, WebView2
Docs: Visual layer | Composition animations | Composition effects
<Window.SystemBackdrop>
<MicaBackdrop/> <!-- or MicaBackdrop Kind="BaseAlt" -->
<DesktopAcrylicBackdrop/>
</Window.SystemBackdrop>Also on FlyoutBase.SystemBackdrop, Popup.SystemBackdrop.
- Mica -- opaque, captures desktop wallpaper once, for app base layer
- Mica Alt --
MicaKind.BaseAltvariant - Acrylic -- semi-transparent frosted glass, for transient surfaces (Base/Thin)
Advanced: MicaController/DesktopAcrylicController with customizable FallbackColor, TintColor,
TintOpacity, LuminosityOpacity. Requires MicaController.IsSupported() check.
Use Win2D IGraphicsEffect to define effects compiled into CompositionEffectBrush:
Supported: 2D Affine Transform, Arithmetic Composite, Blend (21 modes), Color Source, Composite (13 modes), Contrast, Exposure, Grayscale, Gamma Transfer, Hue Rotate, Invert, Saturate, Sepia, Temperature/Tint.
Effects can be chained, animated, and applied to XAML via XamlCompositionBrushBase.
- AcrylicBrush -- frosted glass effect
- RevealBrush -- reveal highlight on hover
- RadialGradientBrush -- radial gradient fill
- XamlAmbientLight -- ambient lighting
- RevealBorderLight -- border highlight
- RevealHoverLight -- hover reveal lighting
Docs: System backdrops | Mica | Acrylic | Materials
All on UIElement, routed-event bubbling:
| Event | When |
|---|---|
PointerPressed |
Pointer contacts element |
PointerMoved |
Pointer moves while over element |
PointerReleased |
Pointer lifts |
PointerEntered |
Pointer enters hit-test area |
PointerExited |
Pointer leaves |
PointerCanceled |
Contact abnormally lost |
PointerCaptureLost |
Capture released |
PointerRoutedEventArgs provides: device type, id, position, pressure, tilt, contact rect,
IsInContact, barrel button, eraser, KeyModifiers.
| Event | Description |
|---|---|
Tapped |
Quick press-release |
DoubleTapped |
Two taps in succession |
RightTapped |
Right-click or touch-hold-release |
Holding |
Long press (touch only): Started/Completed/Canceled |
Require ManipulationMode flags: TranslateX/Y, TranslateRailsX/Y, Rotate, Scale,
TranslateInertia, RotateInertia, ScaleInertia, All, System, None.
| Event | Description |
|---|---|
ManipulationStarting |
About to start |
ManipulationStarted |
Movement detected |
ManipulationDelta |
Continuous Translation, Scale, Rotation, Expansion deltas |
ManipulationInertiaStarting |
Finger lifted, inertia begins |
ManipulationCompleted |
Finished |
| Event | Routing | Description |
|---|---|---|
PreviewKeyDown |
Tunneling | Fires before all other key handling |
KeyDown |
Bubbling | Standard key-press |
CharacterReceived |
After KeyDown | Character-level input |
PreviewKeyUp |
Tunneling | Before key-release |
KeyUp |
Bubbling | Standard key-release |
Modifier detection (no CoreWindow in WinUI 3):
var state = InputKeyboardSource.GetKeyStateForCurrentThread(VirtualKey.Control);Intercept handled events: AddHandler(UIElement.KeyDownEvent, handler, handledEventsToo: true)
<Button.KeyboardAccelerators>
<KeyboardAccelerator Key="S" Modifiers="Control"/>
</Button.KeyboardAccelerators>Scoped via ScopeOwner. Auto-appended to tooltips. UIA pattern invocation priority:
Invoke > Toggle > Selection > Expand/Collapse.
Alt-key mnemonics. AccessKey on UIElement, IsAccessKeyScope for nested scopes.
FocusManager static methods: TryMoveFocus(direction), FindNextFocusableElement,
GetFocusedElement, TryFocusAsync.
Focus events (in order): LosingFocus -> GettingFocus -> LostFocus -> GotFocus.
LosingFocus/GettingFocus are cancelable.
Tab: IsTabStop, TabIndex, TabFocusNavigation (Local/Cycle/Once).
XY: XYFocusUp/Down/Left/Right, XYFocusNavigationStrategy.
Source: CanDrag="True", handle DragStarting (populate DataPackage), DropCompleted.
Target: AllowDrop="True", handle DragOver (set AcceptedOperation), Drop (read DataView).
DragUI: customize via e.DragUIOverride (Caption, bitmap).
ListView reorder: AllowDrop="True" + CanReorderItems="True".
Docs: Keyboard events | Keyboard accelerators | Focus navigation | Drag and drop | Touch guide
Foundation: Execute(parameter), CanExecute(parameter), CanExecuteChanged event.
Controls with Command property (Button, AppBarButton, MenuFlyoutItem) auto-call Execute on
click and disable when CanExecute returns false.
ICommand
-> XamlUICommand (adds Label, IconSource, Description, KeyboardAccelerators, AccessKey)
-> StandardUICommand (predefined kinds: Cut, Copy, Paste, Delete, Save, Open, Undo, Redo...)
XamlUICommand fires ExecuteRequested/CanExecuteRequested events.
StandardUICommand provides predefined Label, Icon, Accelerators, Description per kind.
WinUI has no built-in RelayCommand. Use CommunityToolkit.Mvvm's RelayCommand/AsyncRelayCommand
or custom implementation.
Docs: Commanding | XamlUICommand | StandardUICommand
Every standard control has an AutomationPeer exposing it to UI Automation. Custom controls
override OnCreateAutomationPeer().
Core overrides: GetPatternCore, GetClassNameCore, GetAutomationControlTypeCore, GetNameCore,
IsContentElementCore, IsControlElementCore.
Common patterns: IInvokeProvider, IToggleProvider, ISelectionProvider,
IExpandCollapseProvider, IValueProvider, IRangeValueProvider, IScrollProvider,
IGridProvider, IDragProvider, IDropTargetProvider.
The source repo contains 35+ automation peer classes.
| Property | Purpose |
|---|---|
Name |
Accessible name (what screen reader announces) |
LabeledBy |
Points to TextBlock for accessible name |
HelpText |
Supplemental description |
LiveSetting |
Off/Polite/Assertive for live regions |
AutomationId |
Stable test automation identifier |
AccessibilityView |
Content/Control/Raw tree membership |
HeadingLevel |
Level1-9 for navigation landmarks |
LandmarkType |
Custom/Form/Main/Navigation/Search |
IsRequiredForForm |
Required field marker |
<TextBlock AutomationProperties.LiveSetting="Assertive"/>Raise AutomationEvents.LiveRegionChanged when content changes. Assertive = interrupts,
Polite = queued.
| View | Purpose |
|---|---|
| Raw | All automation elements |
| Control | Interactive controls + structural points |
| Content | User-facing content only |
Docs: Accessibility overview | Custom automation peers
Microsoft.UI.Dispatching.DispatcherQueue replaces UWP's CoreDispatcher. Thread singleton.
dispatcherQueue.TryEnqueue(DispatcherQueuePriority.Normal, () => { /* UI work */ });Priorities: High, Normal, Low. Check HasThreadAccess before dispatching.
| Method | Use |
|---|---|
CreateOnCurrentThread() |
Initialize for calling thread |
CreateOnDedicatedThread() |
New thread with own queue |
ShutdownQueue() |
Sync shutdown (XAML Islands) |
ShutdownQueueAsync() |
Async shutdown (dedicated threads) |
Shutdown order: ShutdownStarting -> drain -> FrameworkShutdownStarting -> drain ->
FrameworkShutdownCompleted -> ShutdownCompleted.
Some components (MicaController) need Windows.System.DispatcherQueue. Call
DispatcherQueue.EnsureSystemDispatcherQueue().
CoreWindow/CoreDispatcher are NOT available in WinUI 3 desktop apps.
Docs: DispatcherQueue
Microsoft.UI.Windowing.AppWindow -- high-level HWND abstraction. 1:1 with top-level windows.
AppWindow appWindow = this.AppWindow; // from Window (SDK 1.3+)Resize(SizeInt32), ResizeClient(SizeInt32), Move(PointInt32), MoveAndResize(RectInt32).
Z-order: MoveInZOrderAtTop(), MoveInZOrderAtBottom(), MoveInZOrderBelow(WindowId).
| Presenter | Description |
|---|---|
| OverlappedPresenter | Standard window with border/title bar/min/max/close (default) |
| FullScreenPresenter | Full-screen, no border, hides taskbar |
| CompactOverlayPresenter | Always-on-top, 16:9 (picture-in-picture) |
OverlappedPresenter config: IsResizable, IsMaximizable, IsMinimizable, IsAlwaysOnTop,
IsModal, HasBorder/HasTitleBar, PreferredMinimumWidth/Height.
Factory methods: Create(), CreateForDialog(), CreateForToolWindow(), CreateForContextMenu().
AppWindow.TitleBar: ExtendsContentIntoTitleBar, foreground/background colors, button colors,
SetDragRectangles(RectInt32[]), IconShowOptions.
Each window is a new Window() instance with its own XAML tree and DispatcherQueue.
AppWindow.Changed (position, size, presenter, visibility, z-order), Closing (cancelable),
Destroying.
Docs: Manage app windows | Title bar | Multiple windows
Override OnLaunched(LaunchActivatedEventArgs) to create main window.
Application.Resources for app-wide XAML resources. Application.RequestedTheme for theme.
All activation goes through OnLaunched. Check kind via:
var args = AppInstance.GetCurrent().GetActivatedEventArgs();
// args.Kind: Launch, File, Protocol, ShareTarget, Search, AppNotification, StartupTask, etc.Do NOT use the LaunchActivatedEventArgs parameter -- it always reports Launch.
WinUI 3 is multi-instance by default. Single-instance via AppInstance.FindOrRegisterForKey +
RedirectActivationToAsync in Main().
Desktop WinUI 3 apps do NOT receive UWP-style Suspending/Resuming events. Save state on window close or app-specific triggers.
Application.UnhandledException -- set e.Handled = true to prevent termination. Fires for XAML
framework and WinRT exceptions.
Docs: App lifecycle migration | App instancing
Use PrintManagerInterop.GetForWindow(hWnd) (required in WinUI 3). PrintDocument events:
Paginate, GetPreviewPage, AddPages. Show UI via PrintManagerInterop.ShowPrintUIForWindowAsync.
Windows.ApplicationModel.DataTransfer.Clipboard. SetContent(DataPackage),
GetContent().GetTextAsync(). Formats: Text, HTML, RTF, Bitmap, StorageItems, Uri.
ContentChanged event. Only accessible when app is in focus.
SDK 1.8+ (recommended): Microsoft.Windows.Storage.Pickers.FileOpenPicker(appWindow.Id).
Older: Windows.Storage.Pickers with InitializeWithWindow.Initialize(picker, hWnd).
Types: FileOpenPicker, FileSavePicker, FolderPicker.
Docs: Printing | File pickers | Clipboard
var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(myWindow);
WindowId id = Win32Interop.GetWindowIdFromWindow(hWnd);
AppWindow appWindow = AppWindow.GetFromWindowId(id);Host WinUI 3 content in non-XAML apps via DesktopWindowXamlSource. Requires
DispatcherQueue initialization and synchronous shutdown.
Standard C++ projection for WinRT APIs. Namespace: Microsoft::UI::Xaml (WinUI 3).
Patterns: auto button = Button();, button.Click({this, &Page::OnClick});, co_await.
Microsoft.Windows.CsWinRT NuGet. TFM: net8.0-windows10.0.19041.0.
.As<T>() for COM casting.
C#: <CsWinRTComponent>true</CsWinRTComponent>, WinRT-compatible public surface only.
C++/WinRT: MIDL 3.0 IDL files, generates headers and implementations.
| Interface | Purpose |
|---|---|
IWindowNative |
Get HWND from Window |
IInitializeWithWindow |
Initialize pickers/dialogs with owner HWND |
IDesktopWindowXamlSourceNative |
XAML Islands HWND management |
Docs: C#/WinRT | MIDL 3.0 | XAML Islands
DependencyObject
UIElement
FrameworkElement
Control
ContentControl -- single Content object
Frame, Page, AppBarButton, NavigationViewItem,
TabViewItem, Expander, ScrollViewer, ContentDialog
ItemsControl -- collection via Items/ItemsSource
Selector -- adds SelectedItem/SelectedIndex
ListViewBase (ListView, GridView)
ComboBox, ListBox, FlipView, TabView
MenuFlyoutPresenter, TreeView
| Control | Virtualization |
|---|---|
| ListView/GridView | Built-in via ItemsStackPanel / ItemsWrapGrid |
| ItemsView | Built-in (uses ItemsRepeater internally) |
| ItemsRepeater | Built-in with VirtualizingLayout in scroll host |
| ItemsControl (base) | None -- avoid for large collections |
| TreeView | Built-in, expands on demand |
Performance: x:Phase for incremental loading, ContainerContentChanging for deferred binding.
- ItemsSourceView -- data source abstraction
- SelectionModel -- selection state management with hierarchical support
- ElementFactory / RecyclingElementFactory -- element creation and recycling
- ElementManager -- manages element lifecycle
- Vector<T> -- generic vector
- HashMap<K,V> -- generic hash map
- BindableVector -- bindable collection base
- VectorChangedEventArgs -- collection change notifications
Docs: Optimize ListView/GridView
From microsoft-ui-xaml-lift:
| Category | Count |
|---|---|
| Public controls/components | 48+ |
| IDL definition files | 121 |
| C++ header files | 565 |
| C++ implementation files | 600 |
| XAML theme resource files | 384 |
| C# managed files | 479 |
| Automation peer classes | 35+ |
| Control theme resource files | 40+ |
| Generated property files | 200+ |