I'm trying to modify ToggleButton
Command when it cahnges it's IsChecked
property. My XAML looks like this:
<ToggleButton Content="Profile" Command="{Binding Path=ShowProfileMappingCommand}" CommandParameter="{Binding Path=ProfileMappingParameter}">
<ToggleButton.Style>
<Style TargetType="ToggleButton">
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Command" Value="{Binding Path=ShowProfileMappingCommand}" />
</Trigger>
<Trigger Property="IsChecked" Value="False">
<Setter Property="Command" Value="{Binding Path=HideProfileMappingCommand}" />
</Trigger>
</Style.Triggers>
</Style>
</ToggleButton.Style>
</ToggleButton>
Unfortunately, this doesn't seem to work. My Commands
never get called. Any ideas why this might be the case?
Bool IsChecked
property as the command parameter? Looks like you're overcomplicating this by having 2 different commands, IMO; – Federico Berasategui