I'd like to set the foreground color of the content of my ContentControl to a specific color. The code below shows my attempts to set the color for the text 'Test' but it stays black.
What am I missing?
Thanks,
Guido
<Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"><Grid><ContentControl Grid.Row="0"><ContentControl.Template><ControlTemplate TargetType="{x:Type ContentControl}"><ContentControl Foreground="Yellow" TextBlock.Foreground="Magenta" TextElement.Foreground="Cyan"><ContentPresenter Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" /></ContentControl></ControlTemplate></ContentControl.Template><ContentControl.ContentTemplate><DataTemplate><ContentControl Foreground="Red" TextBlock.Foreground="Green" TextElement.Foreground="Blue" Content="{Binding}" /></DataTemplate></ContentControl.ContentTemplate><!-- Content --><TextBlock>Test</TextBlock></ContentControl></Grid></Window>