Ivan
Ivan

Reputation: 1171

Toggle button to change the property of some other button

I have a toggle button which changes its image base based on whether it is checked and mouse over effect. Now, in addition to this, I want to also change the image base of some other external button, every time the button above is checked/unchecked. I assume I have to bind this button to the events of the above button, just don't know exactly how.

Upvotes: 0

Views: 358

Answers (1)

mm8
mm8

Reputation: 169400

Give the "above" button an x:Name:

...and use a MultiDataTrigger or a DataTrigger in your ControlTemplate:

<MultiDataTrigger>
    <MultiDataTrigger.Conditions>
        <Condition Binding="{Binding IsChecked, ElementName=above}" Value="True" />
    </MultiDataTrigger.Conditions>
    <Setter TargetName="pptSlide_ON_OFF_image" Property="Source" Value="/Image4.png"/>
</MultiDataTrigger>

Upvotes: 1

Related Questions