views:

651

answers:

0

Hello - We are creating an office ribbon that opens up a WPF window that is stored in another WPF Control library project. That WPF window has some themes attached to it that is stored in a ResourceDictionary that is compiled in a separate project.

However when we load up the WPF window, all the themes from the ResourceDictionary are lost.

We can fix this by manually/forcing the theme on the window itself, but this seems like a bad solution. So my question is: how can I load the theme of the new WPF window from the Office Addin application?

Uri uri = new Uri("/Nov.Presentation.RigDoc.WpfResources;component/Shared.xaml", UriKind.Relative);
            Resources.MergedDictionaries.Add(Application.LoadComponent(uri) as ResourceDictionary);