试试这个
<ToggleButton x:Name="ToggleButton"
IsChecked="{Binding SignalButtonSelected, Mode=TwoWay}"
Command="{Binding SignalButtonCommand}">
<Grid>
<Image x:Name="IsCheckedImage"
Source="Images/Buttons/Button signal.png">
<Interactivity:Interaction.Behaviors>
<Core:DataTriggerBehavior Binding="{Binding IsChecked, ElementName=ToggleButton}"
Value="True">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=IsCheckedImage}"
PropertyName="Visibility"
Value="Collapsed" />
<Core:ChangePropertyAction TargetObject="{Binding ElementName=IsUncheckedImage}"
PropertyName="Visibility"
Value="Visible" />
</Core:DataTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</Image>
<Image x:Name="IsUncheckedImage"
Source="Images/Buttons/Button electric ns.png">
<Interactivity:Interaction.Behaviors>
<Core:DataTriggerBehavior Binding="{Binding IsChecked, ElementName=ToggleButton}"
Value="False">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=IsCheckedImage}"
PropertyName="Visibility"
Value="Visible" />
<Core:ChangePropertyAction TargetObject="{Binding ElementName=IsUncheckedImage}"
PropertyName="Visibility"
Value="Collapsed" />
</Core:DataTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</Image>
</Grid>
</ToggleButton>