I'm trying to assign some SystemColor foreground to a TextBlock on XAML for WPF. The main idea is to make the app more accessible, i.e. to be seen nicely also with High Contrast.
I've tried the following code, but it doesn't have any effect on the color displayed:
<StackPanel Orientation="Horizontal"
Background="{DynamicResource {x:Static SystemColors.HotTrackBrush}}">
<TextBlock Text="my app"
HorizontalAlignment="Left"
Style="{StaticResource MainPageText}"
VerticalAlignment="Center"
TextWrapping="Wrap"
x:Name="Title"/>
</StackPanel>
I'm pretty new at this, so could you please tell me what you think is the problem?
thanks in advance.
To receive dynamic change notification you need to use
HotTrackBrushKey
.Without dynamic change notification
For a reference see: SystemColors Reference