Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › UWP

WinUI Gallery vs. XAML Controls Gallery: Which Sample Library Should Windows Developers Use?

By Freedom251 Team · · 10 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

There is no single winner. The name “XAML Controls Gallery” refers to what Microsoft now calls WinUI 2 Gallery, the UWP-oriented sample app. WinUI 3 Gallery is the matching reference for WinUI 3 and the Windows App SDK. Use the gallery that targets your project’s framework; a visually similar sample from the other gallery can use different packages, APIs, and application setup.

For a new native Windows desktop app built with WinUI 3 and the Windows App SDK, start with WinUI 3 Gallery. For an existing UWP app using WinUI 2, use WinUI 2 Gallery. The practical question is framework compatibility, not which app has more screenshots or repository activity.

As an Amazon Associate I earn from qualifying purchases.

The name changed: “XAML Controls Gallery” is now WinUI 2 Gallery

Microsoft changed the product names on May 12, 2022. Greg Woo, writing for Microsoft’s WinUI team, announced: “The XAML Controls Gallery and the WinUI 3 Controls Gallery are getting new names! They will be called the WinUI 2 Gallery and the WinUI 3 Gallery respectively.” The announcement is recorded in the WinUI Galleries – Store Update.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

That rename matters when you search for code, open documentation, or select a repository branch. The shared WinUI-Gallery repository uses the main branch for WinUI 3 code and the winui2 branch for WinUI 2 code. The former GitHub address associated with XAML Controls Gallery redirects to this shared repository, so it should not be treated as a separate current product.

Search engines, old blog posts, and questions may still say “XAML Controls Gallery.” Read that phrase as the historical name for WinUI 2 Gallery unless the page clearly discusses the newer WinUI 3 app.

What each gallery targets

WinUI 3 Gallery: Windows App SDK desktop development

WinUI 3 is Microsoft’s native UI framework for new Windows desktop applications. It is delivered through the Windows App SDK rather than as a UWP-only control library. The WinUI 3 Gallery is an interactive companion app for WinUI and Windows App SDK APIs. Its samples demonstrate controls, styles, and functionality in a desktop project that uses the WinUI 3 application model.

The gallery’s README describes interactive samples, tools, and code snippets. A control page can show XAML markup and code-behind, while other pages demonstrate adaptive UI, design guidance, and accessibility guidance. Microsoft’s overview of the framework is available in WinUI 3 – Windows apps.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

WinUI 2 Gallery: UWP development

WinUI 2 Gallery is the successor to XAML Controls Gallery and is aimed at UWP applications. Microsoft’s UWP documentation describes it as an interactive sample app for UWP controls, styles, design guidance, and capabilities. Source for that version is in the winui2 branch of the shared repository.

WinUI 2 and WinUI 3 can present similarly named controls, but their project files, NuGet packages, namespaces, lifecycle assumptions, and supported APIs are not interchangeable. A sample that compiles in one model may require substantial changes in the other.

Quick identity table

Gallery name today Former or related name Primary framework Application model Repository location
WinUI 3 Gallery WinUI 3 Controls Gallery WinUI 3 Windows App SDK desktop apps main branch of microsoft/WinUI-Gallery
WinUI 2 Gallery XAML Controls Gallery WinUI 2 UWP apps winui2 branch of microsoft/WinUI-Gallery

Which gallery is better for your project?

Match the gallery to the framework declared by the project before evaluating a sample’s appearance or API. This decision resolves most comparisons immediately.

Your project or task Use first Reason
New Windows desktop application using WinUI 3 and Windows App SDK WinUI 3 Gallery Its controls and samples are aligned with the desktop framework and Windows App SDK APIs.
Existing UWP application using WinUI 2 WinUI 2 Gallery It reflects UWP project setup and WinUI 2 packages.
Reading an old article that says “XAML Controls Gallery” WinUI 2 Gallery, winui2 branch The old name identifies the WinUI 2 version.
Comparing a control’s design or accessibility guidance across generations Open both, then keep the sample that matches the target framework Visual concepts may carry over, but code and API details can differ.
Looking for lifecycle, windowing, or push-notification samples Windows App SDK samples repository The galleries focus on interactive controls and UI guidance rather than being a complete feature-sample catalog.

Microsoft’s official material does not establish an exhaustive control-count comparison, a sample-by-sample parity score, or independent quality testing that would support a universal ranking. “Better” therefore means “more directly compatible with the project you are building.”

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What WinUI 3 Gallery provides

Interactive control exploration

You can run a control sample, change properties, and see the resulting behavior instead of relying on a static code listing. This is useful for understanding visual states, input behavior, layout, and style interactions before adding a control to an application.

Markup and code-behind

The control pages expose XAML and corresponding code-behind. Use the sample to learn the minimum declarations, event handlers, and object setup, then adapt those pieces to your own view model and navigation structure. Do not copy a namespace or package reference without checking that it belongs to your Windows App SDK and WinUI version.

Adaptive UI, design, and accessibility context

The gallery is more than a collection of isolated widgets. Its examples include adaptive UI patterns and design guidance, and it identifies accessibility considerations. That context helps you choose responsive layouts, understand control behavior at different window sizes, and avoid treating a visually correct sample as automatically usable with keyboard, screen-reader, or high-contrast settings.

Experimental API demonstrations

The repository README says the gallery uses an experimental Windows App SDK to demonstrate upcoming features. Examples using experimental APIs are labeled. Those APIs can change or be removed before a stable release, so treat the sample as a way to investigate an evolving capability rather than as a promise of production stability. Check the label and the API status before designing an application around it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What WinUI 2 Gallery provides

UWP-oriented controls and styles

WinUI 2 Gallery presents UWP controls, styles, capabilities, and design guidance in the app model used by UWP projects. If your application already references WinUI 2 packages, its markup and setup are the closest starting point for reproducing a sample.

Historical documentation that remains useful

Many UWP tutorials and support discussions still use “XAML Controls Gallery.” The current UWP development index points readers to the WinUI 2 Gallery identity and its winui2 source branch. When a tutorial gives the old name, verify that its package versions, project type, and branch are UWP-compatible before following the instructions.

Why a WinUI 2 sample may not port directly

WinUI 3 is not simply a renamed UWP project. Desktop app packaging, application lifecycle, windowing, deployment, and Windows App SDK integration can change how a control is initialized or hosted. You may be able to reuse the XAML concept, but you should expect to adjust project references, namespaces, startup code, and capability assumptions.

Side-by-side comparison by the questions developers actually ask

Criterion WinUI 3 Gallery WinUI 2 Gallery
Framework match WinUI 3 with Windows App SDK WinUI 2 for UWP
Best starting point for a new Windows desktop app Yes, when the app uses WinUI 3 No; it targets the UWP model
Best starting point for an existing UWP app No; samples may require porting Yes
Interactive samples Documented by Microsoft as a core purpose Documented as an interactive UWP sample app
Markup and code-behind Shown on control pages Available in the UWP-oriented sample source
Adaptive UI and design guidance Included Included as UWP-oriented guidance
Accessibility guidance Included in the documented WinUI 3 gallery material Included in the documented UWP gallery material
Experimental API caveat README explicitly warns that some examples use experimental Windows App SDK APIs No equivalent current WinUI 3 experimental-API statement applies; evaluate the API and package version used by the UWP sample
Measured sample parity or quality ranking Not established by the official material Not established by the official material

How to use the right gallery without copying incompatible code

  1. Identify the project model. In Visual Studio, inspect the project type and references. A Windows App SDK/WinUI 3 desktop project is a different target from a UWP project that references WinUI 2.
  2. Open the matching gallery. Use WinUI 3 Gallery for the former project and WinUI 2 Gallery for the latter. If you reach an old “XAML Controls Gallery” link, follow it to the current WinUI 2 resources.
  3. Search for the exact control or behavior. Search by the control name and by the behavior you need, such as validation, keyboard focus, responsive layout, or a visual state. A control page may answer a different question from a feature-level sample.
  4. Read the sample’s markup and code-behind together. Note namespaces, resources, event handlers, attached properties, and any initialization performed outside the page. Copying only the visible XAML can omit required setup.
  5. Check API and package status. Look for experimental labels in WinUI 3 Gallery and compare the sample’s Windows App SDK or WinUI package version with your project. An API name alone does not prove version compatibility.
  6. Reproduce the smallest case. Add the control to a minimal page in your project, build, and run it before integrating it with navigation, data binding, or custom styles. This isolates framework and namespace errors.
  7. Test the behavior you actually need. Exercise keyboard navigation, resizing, focus changes, screen-reader labels, localization, and high-contrast or theme changes where relevant. A gallery demonstration is a reference, not a substitute for application testing.
  8. Record the source branch and version. Keep a note of whether the code came from main or winui2, along with the package versions used. This makes future updates and troubleshooting much easier.

Build and execution requirements for WinUI 3 Gallery

The WinUI 3 Gallery README lists Visual Studio 2022 or later for building, the Windows application development component, and Windows 10 or later for execution. Install the workload before opening the solution; otherwise Visual Studio may report missing targets or SDK components that look like sample-code errors.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

These requirements describe the gallery repository’s documented environment, not a guarantee that every current Windows App SDK sample runs identically on every Windows build. If a build fails, first compare the repository’s project configuration, installed Windows SDK, Windows App SDK package, and target architecture with your local setup.

Common mistakes and how to recover

Using the old name as if it were a third gallery

There are two current gallery identities in this comparison: WinUI 2 Gallery and WinUI 3 Gallery. “XAML Controls Gallery” is the former name of WinUI 2 Gallery, not an additional library that should be judged separately.

Choosing by visual similarity

Controls can look alike across WinUI generations while relying on different APIs and project infrastructure. Start with the framework match, then compare the specific sample you need.

Copying a WinUI 2 sample into a WinUI 3 project unchanged

Port the concept deliberately. Recheck package references, namespaces, application startup, windowing, lifecycle, resources, and deployment assumptions. If the sample depends on UWP-only behavior, find the corresponding Windows App SDK approach instead of forcing the old setup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Treating an experimental sample as stable API guidance

WinUI 3 Gallery labels examples that use experimental Windows App SDK APIs. Read those labels, consult the API documentation for your installed version, and isolate experimental code behind a design that can tolerate breaking changes.

Expecting the gallery to cover every Windows App SDK feature

The gallery is optimized for controls, UI behavior, and design reference. Microsoft’s Samples and tools for Windows development page also points to the broader Windows App SDK samples repository, which includes examples for app lifecycle, windowing, push notifications, and other platform features. Use that repository when the question is about an app capability rather than a control’s presentation.

Ignoring accessibility because the sample works visually

Use the gallery’s accessibility guidance as a starting point, then verify names, descriptions, focus order, keyboard access, contrast, and dynamic content in your own application. Custom templates and styles can remove accessibility behavior that the default sample supplied.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

A practical decision framework

If you are starting a new desktop project

Microsoft positions WinUI 3 as its recommended native UI framework for new Windows desktop applications. Create or confirm a Windows App SDK/WinUI 3 project, then use WinUI 3 Gallery to investigate controls and UI patterns. Move to broader Windows App SDK samples only when the feature is outside the gallery’s control-and-design focus.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If you maintain a UWP application

Stay with WinUI 2 Gallery while the application remains a UWP project. Its examples reflect the packages and app model you already use. When evaluating a migration to WinUI 3, treat the gallery as a compatibility reference for the destination framework, not as proof that a UWP sample will port unchanged.

If you are comparing implementation options

Open the matching gallery first, identify the exact API and behavior, and then inspect the other gallery only for design ideas or historical context. Keep a written distinction between reusable XAML concepts and framework-specific code.

If you are troubleshooting a build

Confirm the branch, project type, Visual Studio workload, Windows SDK, Windows App SDK or WinUI package version, and target architecture before changing the sample. A compile error often indicates that code from the wrong gallery was selected rather than that the control itself is unavailable.

What “better” means in this comparison

For a WinUI 3 desktop developer, WinUI 3 Gallery is better because it is the directly aligned reference. For a UWP developer using WinUI 2, WinUI 2 Gallery is better for the same reason. Neither choice proves that every control page is more complete, more stable, or higher quality than its counterpart; the official sources do not publish a parity metric or independent ranking.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The most reliable evaluation combines five checks: framework match, coverage of the exact task, usefulness of the markup and code-behind, quality of design and accessibility context, and setup or API stability. A gallery that fails the first check is usually the wrong starting point even if its sample looks closer to your desired interface.

Final recommendation

Use the name and branch as a quick diagnostic: WinUI 3 Gallery on main for Windows App SDK desktop apps; WinUI 2 Gallery on winui2 for UWP apps. Verify package versions, watch for experimental labels, and use the broader Windows App SDK samples repository for platform features beyond controls. That framework-first workflow is more dependable than trying to declare one gallery the universal winner.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

UWPWindows App SDKWindows developmentWinUIWinUI 2WinUI 3XAML

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.