We have a nested DockSite for which I create a TintedDictionary of the current theme. The color is the TabTintColor of the DocumentWindow the Docksite is nested in. Within this nested DockSite, I'd like to access some Brushes from this TintedDictionary via DynamicResource. How can I accomplish this? I use the following code:
private void CreateThemeDictionary()
{
m_ThemeName = String.Format("Theme{0}{1}{2}", this.TabTintColor.R, this.TabTintColor.G, this.TabTintColor.B);
try
{
if (!ThemeManager.IsThemeRegistered(m_ThemeName))
{
ResourceDictionary _dockingResourceDictionary = ThemeManager.GetResourceDictionary(ThemeManager.CurrentTheme, DockingCommonDictionary.GroupName);
TintedResourceDictionary _tintedDictionary = new TintedResourceDictionary(_dockingResourceDictionary, this.TabTintColor);
ThemeManager.Register(m_ThemeName, DockingCommonDictionary.GroupName, _tintedDictionary);
}
this.Frame.LoadCompleted += new LoadCompletedEventHandler((object sender, NavigationEventArgs e) =>
{
ThemeManager.SetTheme((DependencyObject)this.Page.NestedDockSite, m_ThemeName);
});
}