Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xaml parse exception when attempting to load xaml from codebehind

I have the following line of code defined in codebehind in silverlight:

Path path = XamlReader.Load( "<Path Data=\"F1 M 44.207,34.0669C 44.4841,33.7278 44.7612,33.3886 45.0383,33.0494\" />" ) as Path;

enter image description here

No idea why it's happening...

like image 448
meds Avatar asked Mar 30 '26 17:03

meds


1 Answers

As the exception states, you are missing the default namespace in your XAML document. The <Path> element needs an XML namespace.

Add the attribute xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" to your Path element.

http://msdn.microsoft.com/en-us/library/ms747086.aspx

And for reference, in case you're not familiar with them, as XAML is just XML, here is an introduction to XML namespaces: http://www.w3schools.com/xml/xml_namespaces.asp

like image 60
Adam Sills Avatar answered Apr 02 '26 13:04

Adam Sills



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!