Two differently tinted DockSites

Docking/MDI for WPF Forum

Posted 14 years ago by (Anonymous)
Version: 10.2.0530
Avatar
We have a main DockSite with a nested DockSite.

The main DockSite has multiple DocumentWindows with a different TabTintColor set.
The nested DockSite is tinted via ThemeManager.SetTheme, where I use a TintedResourceDictionary which uses the actual TabTintColor from the parent DocumentWindow.

I know that SetTheme should not be used for production (memory leaks?). How can I have two DockSites with different Themes without using the ThemeProperty?

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Alexandre,

If you call "ThemeManager.SetTheme(this, "Office2010Blue")", then you should be able to avoid the memory leak by calling "this.ClearValue(ThemeManager.ThemeProperty)" when "this" is no longer needed.

ThemeManager.SetTheme merges the theme ResourceDictionary instances into the Resources of the specified element to apply the theme. The registered theme ResourceDictionary instances are all singleton instances, to reduce memory usage. The WPF ResourceDictionary retains a reference to any "owning" elements. So if the element is no longer needed, it would still be referenced by the WPF ResourceDictionary.

By clearing the ThemeProperty, it removes the theme ResourceDictionary instances from the specified element, thus removing it as an "owner".


Actipro Software Support

Posted 14 years ago by (Anonymous)
Avatar
Thank you, I'll try that.
The latest build of this product (v24.1.3) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.