tags:

views:

153

answers:

1

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
Seems like this will do it. Thanks.
jeff