How to set TextBlock background color for HighContrast Theme in UWP

Abu Raihan 21 Reputation points
2020-05-26T12:56:25.253+00:00

In Microsoft UWP application I tried to set a TextBlock background color using Grid in XAML. It was okay for default theme. But When I enable HighContrast Theme, only the Filled Text portion is black color; while remaining portion of the TextBlock is changed according to HighContrast Theme. I also tried with Border but the problem still occurs. I also tried with Style property, same issue.

<Grid Height="50" Width="500" Background="{ThemeResource SystemColorHighlightColor}">
        <TextBlock Text="High Contrast" Width="250" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center"/>
    </Grid>

Can anyone help me to fix this issue?

Universal Windows Platform (UWP)
{count} votes