MaterialDesignThemes.CustomResources 1.0.0

dotnet add package MaterialDesignThemes.CustomResources --version 1.0.0                
NuGet\Install-Package MaterialDesignThemes.CustomResources -Version 1.0.0                
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="MaterialDesignThemes.CustomResources" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MaterialDesignThemes.CustomResources --version 1.0.0                
#r "nuget: MaterialDesignThemes.CustomResources, 1.0.0"                
#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.
// Install MaterialDesignThemes.CustomResources as a Cake Addin
#addin nuget:?package=MaterialDesignThemes.CustomResources&version=1.0.0

// Install MaterialDesignThemes.CustomResources as a Cake Tool
#tool nuget:?package=MaterialDesignThemes.CustomResources&version=1.0.0                

MaterialDesignThemes.CustomResources

A mitigation for a WPF memory leak

WPF (.net core and full .net) has a memory leak regarding using a font source with FontFamily. This is discussed in issue #746 from Material Design in Xaml Toolkit

This solution/mitigation is based on Dominic Jonas idea and adapted to be used/integrated by Material Design in Xaml Tookit.

To verify the issue open the full .net Demo and change the MainPage, Page1 and Page2 to use default font family sintax:

FontFamily="{DynamicResource MaterialDesignFont}"

Follow steps:

  1. Run it;
  2. Take a snapshot from Visual Studio Diagnostics Tool.
  3. Look form Unmanaged Resources. You find 101.
  4. Open Page 1;
  5. Take a snapshot from Visual Studio Diagnostics Tool.
  6. Look form Unmanaged Resources. You find 106.
  7. Open Page 2;
  8. Take a snapshot from Visual Studio Diagnostics Tool.
  9. Look form Unmanaged Resources. You find 110.
  10. Open Page 1 again;
  11. Take a snapshot from Visual Studio Diagnostics Tool.
  12. Look form Unmanaged Resources. You find 113.

Apply the fix in the MainPage, Page1 and Page2:

FontFamily="{customResources:FontResource FontName=Roboto}"

And redo the steps. You won't see the same problem.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.7.2

    • 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
1.0.0 6,655 12/14/2019