Upgrading Uno Toolkit
UnoFeatures: Toolkit (add to <UnoFeatures> in your .csproj)
Upgrading to Uno Toolkit 9.0
Uno Toolkit 9.0 takes a dependency on Uno Themes 7.0, which introduces seed-based color generation and a unified design-token system. It also drops UWP support and reshapes the public surface of the theme classes. Most apps that consume <MaterialToolkitTheme/> or <SimpleToolkitTheme/> via XAML will not need code changes, but several behaviors and defaults have shifted.
UWP target dropped
The Uno Toolkit packages no longer target UWP and migrate to the
Uno.Sdksingle-project model. Apps must be on .NET 6+ / WinUI to upgrade. UWP-only consumers should remain on the 8.x line.Generated resource paths renamed
The
WinUI/UWPpackage-name suffix has been removed from the toolkit's generated resource dictionary URIs.Before After ms-appx:///Uno.Toolkit.WinUI/Generated/mergedpages.WinUI.xamlms-appx:///Uno.Toolkit.WinUI/Generated/mergedpages.xamlms-appx:///Uno.Toolkit.WinUI.Material/Generated/mergedpages.WinUI.v2.xamlms-appx:///Uno.Toolkit.WinUI.Material/Generated/mergedpages.v2.xamlThis only affects code that merged these dictionaries directly by URI. Apps using
<MaterialToolkitTheme/>or<SimpleToolkitTheme/>are unaffected.MaterialToolkitThemeand newSimpleToolkitThemeinherit from their underlying themePreviously
MaterialToolkitThemederived fromResourceDictionaryand instantiatedMaterialThemeinternally as a merged dictionary. It now derives fromMaterialThemedirectly, and the newSimpleToolkitThemederives fromSimpleTheme. The override dependency properties (FontOverrideSource,ColorOverrideSource,FontOverrideDictionary,ColorOverrideDictionary) are now inherited fromBaseThemein Uno Themes.Source-compatible for normal XAML and C# usage — no changes required if you set these properties via XAML attributes or the standard property accessors. Reflection-based code that asserts the inheritance chain (e.g.
typeof(MaterialToolkitTheme).BaseType == typeof(ResourceDictionary)) will need to walk the chain instead.Important
Because
MaterialToolkitThemeis now also aMaterialTheme, do not initialize both<MaterialTheme/>and<MaterialToolkitTheme/>in the sameApp.xaml— that would cause duplicate theme initialization. The same applies to<SimpleTheme/>and<SimpleToolkitTheme/>. The toolkit theme already initializes the underlying theme.New
Colorsproperty — recommended replacement forColorOverrideDictionary/ColorOverrideSourceThe new
Colorsproperty is aThemeColorsobject that bundles seed colors and override dictionaries. It is the recommended way to customize theme colors going forward. The legacyColorOverrideDictionaryandColorOverrideSourceproperties still work, and are now routed internally throughColors.OverrideDictionary.<MaterialToolkitTheme xmlns="using:Uno.Toolkit.UI.Material" xmlns:ut="using:Uno.Themes"> <MaterialToolkitTheme.Colors> <ut:ThemeColors PrimarySeed="#2196F3" OverrideSource="ms-appx:///Style/ColorPaletteOverride.xaml" /> </MaterialToolkitTheme.Colors> </MaterialToolkitTheme>Default Material palette is now seed-generated
MaterialToolkitThemenow uses a default primary seed color (#5946D2) to algorithmically generate the Material Design 3 tonal palette. This produces a different visual result than 8.x's static palette. To preserve the previous look, setColors.PrimarySeedto your desired anchor color or useColors.OverrideDictionaryto override individual color resources.SimpleToolkitThemestill defaults to the standard neutral Simple palette; if you do not specify anyColorsseeds or overrides, apps keep the default neutral appearance. In current documentation this default Simple palette may be described as being produced from the built-in neutral gray seed (#808080), rather than from an app-specified seed.ColorOverrideDictionaryprecedence changedPreviously, color overrides were merged as a base palette before any seed-derived palette. They are now applied as the highest-precedence layer (post-seed) via
Colors.OverrideDictionary. This ensures explicit user overrides always win over seed-generated colors. If you relied on the prior pre-seed merge order, switch to the newColorsproperty and setPrimarySeed/SecondarySeed/TertiarySeedto drive the palette directly.New
DefaultDensityandDefaultCornerRadiuspropertiesBoth toolkit themes now expose density and shape design tokens inherited from
BaseTheme.Property Type Default Description DefaultDensityDensityRegularDrives the base spacing unit used by Space*tokens. Accepted values:Compact(3 px),Regular(4 px),Comfy(5 px). Control heights and icon sizes are unchanged across densities.DefaultCornerRadiusdouble4Base corner radius unit (in pixels). All Radius*tokens are computed as multiples of this.RadiusFullalways remains9999.<MaterialToolkitTheme xmlns="using:Uno.Toolkit.UI.Material" DefaultDensity="Comfy" DefaultCornerRadius="6" />
Upgrading to Uno Toolkit 8.0
Bump to Uno 6.0
Version 8.0 of Uno Toolkit now requires
Uno 6.0.Switch from
ReturnTypetoInputReturnTypeThe
InputExtensionshelper has been updated to use the built-inInputReturnTypeenum (provided by Uno v6+) instead of the legacyReturnTypeenum.// No code changes required in XAML, but under the hood // the attached property now uses InputReturnType: public static DependencyProperty ReturnTypeProperty = DependencyProperty.RegisterAttached( "ReturnType", typeof(InputReturnType), typeof(InputExtensions), new PropertyMetadata(InputReturnType.Default, OnReturnTypeChanged));