Change SelectionHighlight Foreground TextBlock

First of all, my business is UWP applications.

TextBlockhas a property with a name SelectionHighlightColorthat allows you to specify a specific color Selection Areawhen choosing text. Similar:

XAML:

<TextBlock Text="This is a sample text" IsTextSelectionEnabled="True" SelectionHighlightColor="#FFFFE751" Foreground="Black" />

This is displayed as:

enter image description here

If you have not noticed, the foreground text of the selected text will always be White, even if the background of the selection area has a light color.

So, is there a way to change the foreground of the selected control text TextBlock?

+4
source share

Source: https://habr.com/ru/post/1612879/


All Articles