Skip to content

unoplatform/uno.xamlmerge.task

Folders and files

NameName
Last commit message
Last commit date
Nov 20, 2024
Nov 20, 2024
Feb 21, 2025
Feb 21, 2025
Dec 8, 2021
Jan 12, 2022
Dec 8, 2021
Dec 8, 2021
May 13, 2022
Dec 8, 2021
Nov 21, 2024

Repository files navigation

Uno.XamlMerge.Task

An msbuild task which enables the merging of WinUI XAML resource dictionaries into a single flat ResourceDictionary.

This code is derived from WinUI's BatchMergeXaml class, to be reused in any WinUI and Uno Platform Controls library.

Why merge ResourceDictionary instances ?

This task is generally used to allow for separate resource dictionary authoring (which makes them easier to load and read) to avoid impacting resources lookup runtime performance. In WinUI, ResourceDictionary resolution is performed through a graph traversal of MergedDictionaries, which generally implies that a worse case resolution can require as many lookups as there are dictionaries.

To limit the impact of the traversal, this task task takes all resource dictionaries found in a specific MSBuild item group, and merges them into a single file. This file is then generally either named Themes\Generic.xaml or referenced as a merged dictionary from another Themes\Generic.xaml file.

Using the task

See our documentation for more details on how to use this task.