Companion app for WinUI & Windows App SDK APIs
This app demonstrates all of the WinUI 3 controls and styles available to make a modern Windows app with the Windows App SDK. It is the interactive companion to the Fluent Design guidelines and shows the usage of WinUI through interactive samples, tools and code snippets.
Important
This repository is a modified fork of microsoft/WinUI-Gallery, converted to a single-package, single-executable dual-entry app:
| Contract | AUMID suffix | Runtime |
|---|---|---|
| UWP | !App |
WinUI 3 in a UWP AppContainer (CoreWindow + PLM) |
| Win32 | !Win32 |
Packaged classic full-trust Win32 |
The UWP host follows the experimental themerror/WinUI3-on-UWP technique. It relies on the undocumented HKLM\SOFTWARE\Microsoft\WinUI\Xaml\EnableUWPWindow=1 switch and is intended for research only.
-
WinUI controls samples: each control page shows the markup and codebehind used to create each example.
-
Use the Microsoft.UI.Xaml (WinUI) library: the app includes the latest WinUI NuGet package and shows how to use the WinUI controls like NavigationView, SwipeControl, and more.
-
Adaptive UI: in addition to showing how each control responds to different form factors, the app itself is responsive and shows various methods for achieving adaptive UI.
-
Design & accessibility guidance: design and accessibility pages help make the gallery a useful developer companion app.
Program.csselects the UWP or Win32 contract withAppPolicyGetWindowingModel; theEnableUWPWindowregistry check applies only to UWP.GalleryShellhosts the shared NavigationView, Frame, title bar and navigation logic.MainWindowis the Win32Windowhost; the UWP path stores the shell inWindow.Current.Content.- Both
Package.appxmanifestandPackage.Dev.appxmanifestdeclareApp(UWP) andWin32(windows.fullTrustApplication) entries. - PLM lifecycle is handled through
CoreApplicationevents andSuspensionManager; the root frame is registered asAppFrame. - UWP title-bar drag regions use the CoreWindow
ICoreWindowInteropHWND andInputNonClientPointerSourcecaption/passthrough regions. - The Home page title shows
WinUI Gallery on WindowsApp(UWP)orWinUI Gallery on PackagedClassicAppfor the active contract.
| Entry | Trust / runtime | Title bar | Notes |
|---|---|---|---|
!App |
UWP AppContainer, CoreWindow, PLM | UWP extended title bar with manual drag/passthrough regions | Research mode; typed text input unavailable |
!Win32 |
Packaged full trust, classic Win32 Window | Mica + Window.SetTitleBar |
Full desktop behavior; use for text entry |
- Typed text input is not available: text controls can paste but cannot receive typed characters. Use the
!Win32entry for text entry. - WinUI 3
MicaBackdrop/SystemBackdropis not implemented in UWP mode; the theme acrylic brush is used as a fallback. TabularControlsResourcesandXamlChartsResourcesare omitted because their resources are not available to the UWP AppContainer; those experimental sample pages are unavailable.- Desktop-only samples such as multi-window, AppWindow title bar and modal window may not work.
- Title-bar passthrough hit testing can be unreliable; use the title-bar background drag region.
Any samples or docs improvements you'd like to see? We're always looking for a helping hand. Feel free to file an issue to start the discussion, or even better, create a PR with the change you'd like to see!
Check out these help wanted issues if you don't know where to start.
You can also learn more about current happenings with WinUI Gallery in the project board.
Quick start guide to building the WinUI Gallery:
Note
The WinUI Gallery requires Visual Studio 2026 or the winapp CLI to build and Windows 10 or later to execute. If you're building an app with WinUI and Windows App SDK for the first time, follow these installation instructions.
Visual Studio 2026: install the WinUI application development workload.
winapp CLI: enable Developer Mode, install the .NET 10 SDK, and install the CLI:
winget install --id Microsoft.WinAppCli --exact --source wingetgit clone https://github.com/themerror/WinUI-Gallery.gitUpstream Microsoft repository:
https://github.com/microsoft/WinUI-Gallery.git.
Visual Studio: open WinUIGallery.slnx, make sure WinUIGallery is set as the startup project, and press F5.
winapp CLI: from the repository root, run:
winapp run WinUIGallery\WinUIGallery.csprojGallery uses an experimental Windows App SDK to demonstrate upcoming features.
Use the normal Debug or Release configuration; the SDK version is pinned in
standalone.props. In this fork, packaged builds are framework-dependent on
Microsoft.WindowsAppRuntime.2-experimentalF 2.5.4 so the WinUI activation classes
are registered for the UWP contract; unpackaged builds remain self-contained.
Experimental APIs can change or be removed before a stable release.
The Windowing APIs page combines stable window creation with experimental window sizing examples. Each experimental example has its own label and warning; the stable example retains its original APIs.
The fork targets Windows 10 1809+ and requires Developer Mode. The UWP contract also requires the registry switch from the reference repository (run as Administrator):
reg import ..\WinUI3-on-UWP\Enable-UWPWindow.regPublish the unsigned package:
dotnet publish WinUIGallery\WinUIGallery.csproj `
-c Debug -p:Platform=x64 `
-p:AppxBundle=Never `
-p:BuildAllAppFlavors=false `
-p:AppxPackageSigningEnabled=falseRegister the extracted layout in Developer Mode:
$dir = ".\pkg"
New-Item -ItemType Directory -Path $dir -Force | Out-Null
$msix = Get-ChildItem .\WinUIGallery\AppPackages\WinUIGallery_3.0.0.0_x64_Debug_Test\*.msix | Select-Object -First 1
tar -xf $msix.FullName -C $dir
Add-AppxPackage -Register "$dir\AppxManifest.xml"Launch either contract:
$pfn = "Microsoft.WinUI3ControlsGallery.Debug_8wekyb3d8bbwe"
Start-Process "shell:AppsFolder\$pfn!App" # UWP
Start-Process "shell:AppsFolder\$pfn!Win32" # Win32The package is framework-dependent on Microsoft.WindowsAppRuntime.2-experimentalF 2.5.4; install the matching Windows App Runtime first. The MSIX is unsigned in this workflow; for normal deployment sign it with a certificate that matches the manifest Publisher.
Warning
Try deleting nuget.config and building again if you get the following build error:
Assets file 'C:\Users\...\source\repos\WinUI-Gallery\WinUIGallery\obj\WinUIGallery\project.assets.json' not found. Run a NuGet package restore to generate this file.
To learn more about Windows app development, go to the Windows Dev Center.
Maintainers can follow the release runbook to coordinate Microsoft Store publishing with a GitHub release.
- Original project: microsoft/WinUI-Gallery (MIT).
- Modifications in this fork: themerror and contributors (MIT).
- UWP hosting technique: themerror/WinUI3-on-UWP.
- Related references: wherewhere/CoreAppUWP and driver1998/HookCoreAppWinUI.
See LICENSE for the full MIT terms and modification notice.
Thanks to our amazing contributors!
Made with contrib.rocks.

