Compile-Time Validation of Composite Object Data Binding Expressions

2 views
Skip to first unread message

Daniel Vaughan

unread,
Nov 7, 2009, 1:05:56 PM11/7/09
to WPF Disciples, aziz...@gmail.com, fsch...@gmail.com, isuru....@deewr.gov.au, damie...@deewr.gov.au, serge...@deewr.gov.au, Jay....@deewr.gov.au, Michael...@deewr.gov.au, Russel...@deewr.gov.au, Robert....@dfat.gov.au, fha...@pebbleage.ch, sd...@pebbleage.ch, nicolas...@gmail.com
For those of you that might be interested, I have just published a
short article on my blog entitled Compile-Time Validation of Composite
Object Data Binding Expressions with Generated Metadata.
It shows how T4 generated metadata can be used to not only provide
compile time XAML validation of properties on classes, but also
composite classes, and anywhere you need to combine paths. Such as the
SelectedItem in a ListBox like so:
<Label Content="{Binding ElementName=listBox,
Path={Demo:JoinPath
SelectedItem,
{x:Static Metadata:PersonMetadata.Address},
{x:Static Metadata:AddressMetadata.StreetLine}}}"/>

http://danielvaughan.orpius.com/post/Compile-Time-Validation-of-Composite-Object-Data-Binding-Expressions.aspx

Cheers,
Daniel

Glenn Block

unread,
Nov 8, 2009, 12:27:18 AM11/8/09
to wpf-di...@googlegroups.com
Daniel, this sounds awesome. Can't wait to check it out!

--
Sent from my mobile device

Daniel Vaughan

unread,
Nov 8, 2009, 7:14:09 AM11/8/09
to WPF Disciples
Thanks Glenn! Once I get the next Calcium article out there, I want to
look into doing some validation with MSBuild and VS2010
d:DesignInstance, just as we were chatting about with Karl.


On Nov 8, 6:27 am, Glenn Block <glenn.bl...@gmail.com> wrote:
> Daniel, this sounds awesome. Can't wait to check it out!
>
> On 11/7/09, Daniel Vaughan <dbvaug...@gmail.com> wrote:
>
>
>
>
>
> > For those of you that might be interested, I have just published a
> > short article on my blog entitled Compile-Time Validation of Composite
> > Object Data Binding Expressions with Generated Metadata.
> > It shows how T4 generated metadata can be used to not only provide
> > compile time XAML validation of properties on classes, but also
> > composite classes, and anywhere you need to combine paths. Such as the
> > SelectedItem in a ListBox like so:
> > <Label Content="{Binding ElementName=listBox,
> >     Path={Demo:JoinPath
> >                 SelectedItem,
> >                 {x:Static Metadata:PersonMetadata.Address},
> >                 {x:Static Metadata:AddressMetadata.StreetLine}}}"/>
>
> >http://danielvaughan.orpius.com/post/Compile-Time-Validation-of-Compo...
Reply all
Reply to author
Forward
0 new messages