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.
Can anyone help me to fix this issue?
<Grid Height="50" Width="500" Background="{ThemeResource SystemColorHighlightColor}">
<TextBlock Text="High Contrast" Width="250" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>

The above behavior is by-design, and the
TextBlockbackground was controlled by system. If you want to edit it, please go Setting page to find High contrast Setting -> Background. And editBackgroundwill changeTextBlockbackground inHighContrastmodel.And if you want to make Grid has same color, please keep
Selected Textcolor same as Background color.Update
In general, we often set the Grid background as
ApplicationPageBackgroundThemeBrushthat could keep the the textblock background same as the Grid, then avoid the show the black block.Update 1
Please check TextBlock
HighContrastAdjustmenproperty. if we set it as None , the black block will dismiss.