How do I bind to another control's property from a trigger?

You need to specify the trigger as part of a style -- the Triggers collection on the Button itself can only contain event triggers. With that in mind, a DataTrigger works fine. However, there is a wrinkle: the value from the Trigger Setter won't overwrite a local Content property.So you have to set the default Content in the Style as well.

Here's how it looks.

Ah ha! I knew there was a property precedence, but it didn't occur to me that direct would overwrite the Trigger action. I'm using a DP as the binding source and ended up with the same lack of behavior as trying to use ElementName, so the problem was actually with the property precdence.

Thanks for clearing that up! – rrhartjr Mar 26 '10 at 1:58.

He may want his button to say something more meaningful than True or False though *grin*. Which you can do by inserting a converter, of course, but a trigger does feel more idiomatic... – itowlson Mar 26 '10 at 1:17 Mark, I edited your code to get rid of some extraneous bits that I felt made it hard to see the core of your suggestion. Hope this is okay -- if you feel I've distorted your intent then please roll back.

– itowlson Mar 26 '10 at 1:23 that's fine, thanks for that, I just whipped it up real quick and probably should have cleaned it up :) – Mark Mar 26 '10 at 1:53.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions