How to compare values of two controls with a trigger?
Question
I have to buttons, named btnOK and btnSave.
I want that the IsEnabled of btnSave should be the same as the btnOK's value, i.e. if btnOK goes disabled, btnSave should do the same.
I actually need something like (pseudu):
<Button TabIndex="3" Name="btnOK">
<Button.Triggers>
<Trigger Property="IsEnabled">
<Setter TargetName="btnSave" Property="IsEnabled" Value="Self.IsEnabled"/>
</Trigger>
</Button.Triggers>
</Button>
<Button Name="btnSave"/>
Solution
<Button Name="btnOK">OK</Button>
<Button Name="btnSave" IsEnabled="{Binding IsEnabled, ElementName=btnOK}">Save</Button>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow