我在 WPF 中有一个带有 3 个选项卡的 TabControl,每个选项卡在选项卡标题旁边都有一个图像。这是一个例子
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<Image Name="img" Height="auto" Width="auto" Source="images/1.png" />
<TextBlock Text="Login" Margin="2,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</TabItem.Header>
</TabItem>
When the tab is selected the text is black and the background is white, when its not it's a light gray color and a slightly darker text. 这很好用,但我不知道如何更改未选择的选项卡上的图像?现在,图像看起来都一样,内部有一个数字的绿色圆圈,但是当未选择一个数字时,我希望它更改为其他映像,即ia images/1_notselected.png和images/2_notselected.png。是被选中的。谢谢!