C# Disciples

my life in Avalon ….

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.

May 3, 2008 - Posted by marlongrech | WPF | | 2 Comments

2 Comments »

  1. [...] Silverlight Attached Properties for WPF Developers (Marlon Grech) [...]

    Pingback by Dew Drop - May 6, 2008 | Alvin Ashcraft's Morning Dew | May 6, 2008 | Reply

  2. [...] properties to work. After hours of crawling through the web searching for any hint, I finally found this post by [...]

    Pingback by bit.Identities » Blog Archive » Silverlight Attached Properties Issue | May 16, 2008 | Reply


Leave a comment