Silverlight Attached Properties for WPF Developers

Hello fellow WPF geeks,

I stumbled upon an issue in Silverlight 2 Beta 1 with Attached properties. Yes, Silverlight does have Attached properties, but if you are coming from a WPF background than it might be useful for you to know that you MUST include the assembly=myAssemblyName in the xmlns that defines the namespace where your attached property lives. And YES even if the attached property lives in the same assembly as your XAML.

If you don’t you’ll get the following error

Additional information: AG_E_PARSER_PROPERTY_NOT_FOUND

So instead of creating the xmlns like this

xmlns:local="clr-namespace:SLAttachedProperties"

you should do this

xmlns:local="clr-namespace:SLAttachedProperties;assembly=SLAttachedProperties"

Yea, I guess it is a bug, after all it still in BETA🙂

Have loads of fun and a nice weekend.

3 thoughts on “Silverlight Attached Properties for WPF Developers

  1. Pingback: Dew Drop - May 6, 2008 | Alvin Ashcraft's Morning Dew

  2. Pingback: bit.Identities » Blog Archive » Silverlight Attached Properties Issue

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s