Compile time validation of XAML bindings for C# and VB

29 views
Skip to first unread message

Daniel Vaughan

unread,
Sep 2, 2009, 3:13:18 PM9/2/09
to WPF Disciples, isuru....@deewr.gov.au, damie...@deewr.gov.au, fha...@pebbleage.ch, sd...@pebbleage.ch, serge...@deewr.gov.au, Jay....@deewr.gov.au, Michael...@deewr.gov.au, Russel...@deewr.gov.au, ndo...@pebbleage.ch, Robert....@dfat.gov.au
I’ve elaborated on the T4 metadata generation idea a bit, and
published an article on it here

http://www.codeproject.com/KB/codegen/T4Metadata.aspx

The template now generates PropertyPaths for XAML bindings. This means
you get compile time validation of XAML bindings using x:Static.

It supports Silverlight and Desktop CLRs. No binding support in SL
though.
I’ve also ported the template to VB.NET.

There is experimental obfuscation support so that Expression Trees are
used to derive the property/method/field name at runtime.

Let me know what you think.

Cheers,
Daniel

Mike Brown

unread,
Sep 3, 2009, 12:21:07 AM9/3/09
to wpf-di...@googlegroups.com
Did you just say that you've started solving the XAML obfuscation problem? You hear that? It's a sound of a million developers around the world clapping for you.

Daniel Vaughan

unread,
Sep 3, 2009, 4:21:33 AM9/3/09
to WPF Disciples
Hey Mike, yes that's right. Although I wasn't convinced by its
usefulness, so I put a lid on it. But now you say lots of developers
may want it, then perhaps I should push on with it.
I use Expression trees at runtime to determine the member name when it
is requested. The result is then cached.

Cheers,
Daniel


On Sep 3, 6:21 am, Mike Brown <mbrow...@gmail.com> wrote:
> Did you just say that you've started solving the XAML obfuscation problem?
> You hear that? It's a sound of a million developers around the world
> clapping for you.
>
> On Wed, Sep 2, 2009 at 3:13 PM, Daniel Vaughan <dbvaug...@gmail.com> wrote:
>
> > I’ve elaborated on the T4 metadata generation idea a bit, and
> > published an article on it here
>
> >http://www.codeproject.com/KB/codegen/T4Metadata.aspx
>
> > The template now generates PropertyPaths for XAML bindings. This means
> > you get compile time validation of XAML bindings using x:Static.
>
> > It supports Silverlight and Desktop CLRs. No binding support in SL
> > though.
> > I’ve also ported the template to VB.NET <http://vb.net/>.

Laurent Bugnion, GalaSoft

unread,
Sep 3, 2009, 2:00:32 PM9/3/09
to wpf-di...@googlegroups.com
Hey Daniel,

I am very intrigued by the T4 story. After I push my next version of the
MVVM Light toolkit, I would love to have a chat with you about this. Do you
have MSN or Skype?

Cheers,
Laurent

Daniel Vaughan

unread,
Sep 3, 2009, 3:09:26 PM9/3/09
to WPF Disciples
Would love to chat with you sometime Laurent. In fact, I've been
meaning to swing by Zurich to say hello.
I'll send you my msn privately.

Cheers,
Daniel

On Sep 3, 8:00 pm, "Laurent Bugnion, GalaSoft" <laur...@galasoft.ch>
wrote:
Reply all
Reply to author
Forward
0 new messages