I am trying to use a ResourceDictionary in loose XAML and load it a runtime to provide templates and styles to a WPF app. I have the XAML available in a local directory and am adding a new ResourceDictionary to App.Current.Resources.MergedDictionaries in app startup using a URI.
When the XAML goes to parse, it blows up on a template where the TargetType is a custom control from the assembly that is consuming it.
The specific message is:
'Failed to create a 'Type' from the text 'controls:CustomType'.'
I already have the namespace mapped in the ResourceDictionary at the top:
xmlns:controls="clr-namespace:TEST.UI.WPF.Common.Controls"
There are articles out there stating that loading ResourceDictionaries from loose XAML is possible but none of them that I have found address custom types within those loose XAML files.
Any help is appreciated!