I have a Button like this:
<Button x:Name="CloseBtn" Click="CloseBtn_Click" IsEnabled="{Binding IsCloseEnabled}"
HorizontalAlignment="Right" Style="{StaticResource TopButton}">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Height="30" Width="30" Source="{StaticResource CloseIcon}" />
<Label Foreground="Black">Close</Label>
</StackPanel>
</Button.Content>
</Button>
Its style is this:
<Style x:Key="TopButton" TargetType="{x:Type Button}">
<Setter Property="Padding" Value="10,5" />
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="TextBlock.Foreground" Value="#FFADADAD"/>
</Trigger>
</Style.Triggers>
</Style>
However when the binding "IsCloseEnabled" returns false, the button doesn't look like being disabled -- the color "#FFADADAD" isn't applied to the foreground. Not sure where it goes wrong.
Label Foreground="Black"
- why would this change if Button Foreground changes? try to create a Binding between Label Foreground and Button Foreground – ASh