Quantcast
Channel: SharpDevelop Community
Viewing all articles
Browse latest Browse all 1764

Cannot resolve prefix of namespace when custom MarkupExtension classes are used

$
0
0

Hi,

 

 

 

When i use the XamlParser class' ParseSnippet method to get an instance of XamlObject everything works fine. But once i try to add a control which uses a markup extension class, i get the exception 'Unrecognized namespace prefix in type myNS:EmbeddedImageExtension"'. My xaml snippet contains the default ns of the control (xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"). The ns of the prefix myNS is declared in the XamlObject instance which is passed as first parameter in the ParseSnippet method.

 

The MarkupExtensionParser class in line 236 tries to resolve the custom extension ("myNS:EmbeddedImage" + "Extension") but fails.

 

If i change the type resolver's ContainingElement To the root, which actually contains the prefix everything works fine and the extension can be resolved successfully.

 

Is there something im doing wrong or is there a bug?

 

Used SD version: 4.3.3.9663

 

Cheers


Viewing all articles
Browse latest Browse all 1764

Trending Articles