Host UWP controls in WPF and Windows Forms applications
Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
We're bringing UWP controls to the desktop so that you can enhance the look, feel, and functionality of your existing WPF or Windows applications with Fluent Design features. There's two ways to do this.
First, you can add controls directly to the design surface of your WPF or Windows Forms project, and then use them like any other control in your designer. Try this out today with the new WebView control. This control uses the Microsoft Edge rendering engine, and until now, this control was available only to UWP applications. You can find the WebView in the latest release of the Windows Community Toolkit.
Soon, you'll have access to even more Fluent Design features: we'll be providing a control that lets you host a variety of UWP controls. Look for this control and many other controls in future releases of the Windows Community Toolkit.
Here's a quick look at how these controls are organized architecturally. The names used in this diagram are subject to change.
The APIs that appear at the bottom of this diagram ship with the Windows SDK. The controls that you'll add to your designer ship as Nuget packages in the Windows Community Toolkit.
These new controls have limitations so before you use them, please take a moment to review what's not yet supported, and what's functional only with workarounds.
For the most part, everything is supported unless explicitly called out in the list below.
What's supported only with workarounds
✔️ Hosting multiple inbox controls inside of multiple windows. You'll have to place each window in its own thread.
x:Bind with hosted controls. You'll have to declare the data model in a .NET Standard library.
✔️ C#-based third-party controls. If you have the source code to a third-party control, you can compile against it.
What's not yet supported
🚫 Accessibility tools that work seamlessly across the application and hosted controls.
🚫 Localized content in controls that you add to applications which don't contain a Windows app package.
🚫 Asset references made in XAML within applications that don't contain a Windows app package.
🚫 Controls properly responding to changes in DPI and scale.
🚫 Adding a WebView control to a custom user control, (Either on-thread, off-thread, or out of proc).
🚫 The Reveal highlight Fluent effect.
🚫 Inline inking, @Places, and @People for input controls.
🚫 Assigning accelerator keys.
🚫 C++-based third-party controls.
🚫 Hosting custom user controls.
The items in this list will likely change as we continue to improve the experience of bringing Fluent to the desktop.