I just want to make the Label
inside my Button
template look disabled. Scoured the Internet and this seems like a simple task, what I'm doing wrong?
<Button Command="{Binding CommandProcess}">
<StackPanel Orientation="Horizontal">
<Image Source="Images\Cloud-Upload.png"/>
<Label Content="Upload and Process" Foreground="White" VerticalAlignment="Center" FontWeight="Bold" FontSize="18.667" Margin="5,0,0,0">
<Label.Style>
<Style TargetType="Label">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsEnabled, RelativeSource={RelativeSource AncestorType={x:Type Button}}}" Value="False">
<Setter Property="Foreground" Value="Gray"></Setter>
<Setter Property="ToolTip" Value="Please select a record type for each file selected for processing"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Label.Style>
</Label>
</StackPanel>
</Button>
EDIT:
(full code after using the answer by RV1987)
<Button Command="{Binding CommandProcess}" x:Name="ProcessButton">
<StackPanel Orientation="Horizontal">
<Image Source="Images\Cloud-Upload.png"/>
<Label Content="Upload and Process" VerticalAlignment="Center" FontWeight="Bold" FontSize="18.667" Margin="5,0,0,0">
<Label.Style>
<Style TargetType="Label">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsEnabled, ElementName=ProcessButton}" Value="True">
<Setter Property="Foreground" Value="White"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsEnabled, ElementName=ProcessButton}" Value="False">
<Setter Property="Foreground" Value="Gray"></Setter>
<Setter Property="ToolTip" Value="Please select a record type for each file selected for processing"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Label.Style>
</Label>
</StackPanel>
</Button>