Search code examples
c#wpfxamlxml-namespacesvsix

Use ResourceDictionary from Windows.UI.Xaml namespace


I am trying to use the ResourceDictionary.ThemeDictionaries property from Namespace Windows.UI.Xaml on my existing project, but I already have the ResourceDictionary from System.Windows.ResourceDictionary. I cannot figure out how can I use the one from Windows.UI.Xaml, so that I can have the ThemeDictionaries.

enter image description here enter image description here

Do you have any ideas?

Thanks!


Solution

  • I am afraid that ThemeDictionaries and the ResourceDictionary in the Windows.UI.Xaml namespace is a Universal Windows Platform (UWP) thing that is not applicable to WPF.

    A WPF ResourceDictionary and a UWP ResourceDictionary are not the same thing. They are not interchangeable, i.e. you cannot reuse them in both WPF and UWP apps.