The XamlReader is loading Xaml using types defined within the local assembly and the WPF assemblies without any problems.
If I include types defined within external assemblies then a XamlParseException with the following message is thrown.
Cannot create unknown type '{clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting}SeriesMapping'.' Line number '13' and line position '18'.
Is it possible to load types from external assemblies using this technique?
Yes this is possible. The trick is to load the external assemblies into the AppDomain before making the call to XamlReader.Parse.
If the assemblies are referenced from the assembly making the call then the simplest means of doing this would be to declare a variable using a type from that external assembly. Note that it is not necessary to instantiate the type.
Alternatively, the Assembly.Load method can be used to load non referenced assemblies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With