I have a usercontrol, that when one property changes, the bindings change for a number of different embedded controls (in the same user control). Before I waste too much time, is this something that can be done with a Trigger or DataTrigger? I can do it in code behind but this seems 'dirty'.
+3
A:
Sure, the following changes the Text binding of shiftButtonText when the IsPressed property of the current DataContext changes. Is this the type of thing that you're looking for?
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Path=IsPressed}" Value="True">
<Setter TargetName="shiftButtonText" Property="Text" Value="{Binding Path=PressedText}"/>
</DataTrigger>
</DataTemplate.Triggers>
Hope this helps,
Binary Worrier
2009-06-14 11:32:06
Seems like this will do it. Thanks.
jeff
2009-06-14 19:44:06