GroupBoxes のヘッダー用に DataTemplate を定義しました。
<Style x:Key="GroupBoxHeaderStyle" TargetType="{x:Type GroupBox}">
<Setter Property="Foreground" Value="White"></Setter>
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Text="{Binding}" Foreground="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Foreground}"
FontSize="18" FontFamily="Global User Interface"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
ただし、フォアグラウンドに対して行われたバインディングは機能していないようです。私の groupBoxes のヘッダーは常に黒です。私は何を間違っていますか?
これは、GroupBox を定義する方法です。
<GroupBox Header="Views" Margin="1" Foreground="White"
Style="{StaticResource GroupBoxHeaderStyle}">
...