First of all, my case is in UWP apps.
TextBlock
has a property named SelectionHighlightColor
that allows you specify the concrete color of the Selection Area
when you select a text. Just like this:
XAML:
<TextBlock Text="This is a sample text" IsTextSelectionEnabled="True" SelectionHighlightColor="#FFFFE751" Foreground="Black" />
That displays as:
In case you haven't notice, the foreground of selected text is always White
even the background of selection area is of light color.
So is there any way to change the foreground of Selected text of TextBlock
control?
TextBlock
doesnt have a Template and is a sealed class so cant be extended. It has aSelectedText
property andSelectioChanged
event but cant see any brushes to change – Kalsomine