This is a mirror of official site: http://jasper-net.blogspot.com/

Silverlight – DataBind to an Anonymous type (Who knew?)

| Thursday, May 27, 2010
I searched the web for the idea first. I was certain somebody had blogged about this before, and just wanted to quickly confirm it’s truth. Unfortunately all I came across were work-a-rounds and people telling you it’s not possible. So hopefully this post will help the next guy.

All you have to do is expose your privates. Placing the following into your AssemblyInfo.cs will give the built in bindings the ability DataBind to your object(s).

[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("System.Windows")]

I’m not going to say whether this is or is not a good idea, and I’m sure there’s many ways to abuse it.

Don’t inhale too much of this stuff.

Read more: <elegantc*de>

Posted via email from jasper22's posterous

0 comments: