Native WinUI and Uno differences

UnoDock ships two builds in each package: net10.0 for Uno Platform (Skia desktop, WebAssembly, mobile) and net10.0-windows10.0.26100 for native WinUI 3 on the Windows App SDK. The public API, layout model and behavior are the same. This page lists where the two platforms differ, what UnoDock does about each difference, and what an application has to know when it targets native WinUI.

Building

Uno Platform Native WinUI
Build tool dotnet build Visual Studio MSBuild (msbuild)
Packaging in the samples framework-dependent dotnet <app>.dll unpackaged (WindowsPackageType=None), self-contained Windows App SDK

Uno.Sdk refuses to build a WinUI class library that contains XAML with dotnet build (error UNOB0008), because the WinUI XAML compiler needs Visual Studio MSBuild. UnoDock's packages are therefore packed on Windows with MSBuild, and the repository's native WinUI heads build the same way:

msbuild samples/UnoDock.Gallery/UnoDock.Gallery.csproj -restore -p:Configuration=Release -p:Platform=x64 -p:UnoDockTargetFrameworks=net10.0-windows10.0.26100.0 -p:UnoDockLibraryFrameworks=net10.0-windows10.0.26100.0

Applications that only consume the UnoDock package are not affected: an application builds the way any WinUI application does.

On Windows, the package's dependency on Uno.WinUI contributes only the small Uno.UI.Toolkit assembly; Uno's build tasks are excluded.

XAML markup for layouts

The WinUI XAML compiler writes markup as XAML Binary Format (XBF). Two of its limits affect layouts declared in markup, and UnoDock works around both in the WinUI build:

Markup is therefore the same on both platforms, including the content syntax. Code always uses Children. Property-element syntax for the collection (<LayoutPanel.Children>) does not compile on native WinUI; omit it and place the children directly in the group.

Styles, templates and code-only subclasses

Native WinUI checks a Style's or ControlTemplate's TargetType through the application's XAML type metadata, which only describes types that appear in markup. Uno compares the .NET types instead. On WinUI, a class that derives from DockingManager and is only created in code is therefore known only as Control. Applying a style or template with TargetType="dock:DockingManager" to it throws COMException 0x800F1000 ("Cannot apply a Style with TargetType 'UnoDock.DockingManager' to an object of type 'Control'"). On the UI thread, that ends the process.

UnoDock handles the common case itself:

Two things still need the application's help:

```xml