切换按钮以更改其他按钮的属性 [英] Toggle button to change the property of some other button

查看:29
本文介绍了切换按钮以更改其他按钮的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个切换按钮,它根据是否选中和鼠标悬停效果来更改其图像基础.现在,除此之外,每次选中/取消选中上面的按钮时,我还想更改其他一些外部按钮的图像库.我假设我必须将此按钮绑定到上述按钮的事件,只是不知道具体如何.

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.

推荐答案

给上方"按钮一个 x:Name:

...并在您的 ControlTemplate 中使用 MultiDataTriggerDataTrigger :

...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>

这篇关于切换按钮以更改其他按钮的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆