DataTrigger with Binding

This is something i discovered recently. It could be common knowledge but I ended up spending about 30 mins trying to figure out what was happening until i found this fact:

DataTrigger don’t support default binding inference without a path. In other words, you have to give a property to bind to(with or without path=), but can’t just give{Binding} as value and allow the parent datacontext to flow to this property, and then have some kind of converter that cherry picks one property from datacontext’s public properties and returns it as a value to the control. That style works only in standard binding expression outside of DataTrigger.

I had to try various things assuming this was allowed. Evenually figured out, its not allowed, at least in this version of WPF

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your 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