Sundew.Xaml.Optimizers 3.0.0-u20250824-003042-ci

This is a prerelease version of Sundew.Xaml.Optimizers.
This package has a SemVer 2.0.0 package version: 3.0.0-u20250824-003042-ci+81293e52c9.
dotnet add package Sundew.Xaml.Optimizers --version 3.0.0-u20250824-003042-ci
                    
NuGet\Install-Package Sundew.Xaml.Optimizers -Version 3.0.0-u20250824-003042-ci
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sundew.Xaml.Optimizers" Version="3.0.0-u20250824-003042-ci" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sundew.Xaml.Optimizers" Version="3.0.0-u20250824-003042-ci" />
                    
Directory.Packages.props
<PackageReference Include="Sundew.Xaml.Optimizers" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Sundew.Xaml.Optimizers --version 3.0.0-u20250824-003042-ci
                    
#r "nuget: Sundew.Xaml.Optimizers, 3.0.0-u20250824-003042-ci"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Sundew.Xaml.Optimizers@3.0.0-u20250824-003042-ci
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Sundew.Xaml.Optimizers&version=3.0.0-u20250824-003042-ci&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Sundew.Xaml.Optimizers&version=3.0.0-u20250824-003042-ci&prerelease
                    
Install as a Cake Tool

Sundew.Xaml.Optimizers

Usage

Refer to the sample for how to use optimizations: https://github.com/hugener/Sundew.Xaml.Optimizer.Sample

Supported optimizers:

ResourceDictionaryOptimizer

The ResourceDictionaryCachingOptimizer enables caching for merged ResourceDictionaries and has the following advantages:

  1. Merged ResourcesDictionaries are only loaded once.
  2. Tooling and designers will not break, as they see the original WPF ResourceDictionary.
  3. Less overhead maintaining DesignTimerResources.

Supported settings:

  • DefaultReplacementType - Only used with Replace action, formatted as: "prefix|XamlNamespace|TypeName"
  • ReplaceUncategorized - If true, all uncategorized ResourceDictionaries will be replaced with the built-in caching ResourceDictionary.
  • OptimizationMappings - A list of optimizations to apply, default is empty where all ResourceDictionaries are replaced with the built-in caching ResourceDictionary.
    • Category - The category e.g. an emoji charater like 🎨 (likely to be used with Remove) to indicate a "theme" dictionary or ♻️ to shared (recycled) resources.
    • Action - Remove or Replace (With ReplacementType).
    • ReplacementType - Only used with Replace action, formatted as: "prefix|XamlNamespace|TypeName"

FreezeResourceOptimizer

The optimizer changes all WPF Freezable classes such as brushes to frozen unless po:Freeze="False" is set or the key include the UnfreezeMarker.
This improves performance by avoiding that WPF has to clone brushes during rendering.
Note that brushes that get modified (e.g. animated) at runtime must set po:Freeze="False" or use the UnfreezeMarker, otherwise exceptions will be thrown at runtime.
For more information about presentation options see: https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/presentationoptions-freeze-attribute

Supported settings:

  • IncludeFrameworkTypes (true/false), default true ⇒ Includes all WPF freezables.
  • UnfreezeMarker - A string e.g. an emoji character like 💫 that can be used to mark resources as unfrozen. Any resource containing this marker in the key will not be frozen.
  • IncludedTypes (List of xaml type names), default null ⇒ Additional freezables to be included.
  • ExcludedTypes (List of xaml type names), default null ⇒ Freezables to be excluded. Types in IncludedTypes and ExcludedTypes that does not include a XML namespace will use the WPF presentation namespace.

StaticToDynamicResourceOptimizer

This optimizer replaces StaticResource with DynamicResource, which is useful for themes, since the designer/editor can check that resource names actually exist.
At build time these get rewritten to DynamicResource to support refreshing at runtime.

Supported settings:

  • DynamicMarker - A string e.g. an emoji character like 🔄 that can be used to mark resources as dynamic. Any StaticResource containing this marker in the key will be replaced with DynamicResource.
Product Compatible and additional computed target framework versions.
.NET net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net8.0-windows was computed.  net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net9.0-windows7.0 is compatible.  net10.0-windows was computed. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.8

    • No dependencies.
  • net6.0-windows7.0

    • No dependencies.
  • net8.0-windows7.0

    • No dependencies.
  • net9.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-u20250824-003042-ci 90 8/24/2025
3.0.0-u20250824-000407-ci 46 8/24/2025
3.0.0-u20250823-123252-ci 63 8/23/2025

3.0 - Adjust to new platform
2.0 - Added optimizer for freezing Freezables per default.
1.0 - Caching of merged ResourceDictionaries.