Given the following XAML markup, I would expect the text in the Hyperlink to turn orange when I mouse over it, since I am setting a foreground colour on its parent control and it should filter down by Property Value Inheritance. Yet it stays black. What do I need to do?
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<Style x:Key="DemoLink" TargetType="{x:Type Hyperlink}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="DarkOrange" />
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<Label>
<Hyperlink Style="{StaticResource DemoLink}">
<Label Content="Text that should change colour on mouse over" />
</Hyperlink>
</Label>
</Grid>
</Window>
Update: The simple answer from Meleak is that using a TextBlock instead of the inner Label causes the style to work as expected - the TextBlock picks up the foreground colour from its parent, while the Label does not.
e.g.
<Label>
<Hyperlink Style="{StaticResource DemoLink}">
<TextBlock Text="Text that does change colour on mouse over" />
</Hyperlink>
</Label>