Alexander Pacha
Alexander Pacha

Reputation: 9710

Attached Properties throwing ParseException

I've followed the instruction from Adding custom attributes to an element in XAML? but unfortunately the designer tells me that he can't find the element and when starting the program I get an XamlParserException with the message Cannot set unknown member '{clr-namespace:myNs}MediaElementProperties.MediaId'.

My Setup:

Do you have any ideas why I keep getting the exception?

Upvotes: 3

Views: 660

Answers (1)

brunnerh
brunnerh

Reputation: 184296

Attached properties need to be registered with RegisterAttached as noted by Zabavsky.

When using the XamlReader you may need to be required to fully qualify your xmlns, even though the code is in the same assembly, i.e.

xmlns:myNs="clr-namespace:MyNamespace;assembly=MyApplication"

Upvotes: 7

Related Questions