The TextBox's SelectionTextBrush property doesn't work
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
* .NET Core Version: Microsoft.NETCore.App 6.0.0-preview.3.21201.4 / .NET SDKs 6.0.100-preview.3.21202.5
* Windows version: 2004
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
**Problem description:**
Hi, the [SelectionTextBrush](https://docs.microsoft.com/dotnet/api/system.windows.controls.primitives.textboxbase.selectiontextbrush) property of TextBox doesn't work. I've set it to `Red` but nothing happens.
P.S.: I've faced this behavior the research an issue of our VisualStudio wizard - the foreground of the selected text is wrong. It's reproduced only for VS2019. So it's confused me - the property doesn't work in a common case but affects foreground in VS. In addition, our wizard use .Net 4.7.2. Can't understand how it works.

Upd.: I've turned on the high-contrast mode and the color of the selected text in VS wizard changed to `Black` because by default the SelectionTextBrush uses the system's HighlightTextColor. It looks like the VS team use some hack or know something about how to force working this property :)
```csharp
//ReferenceSource
private static Brush GetDefaultSelectionTextBrush()
{
Brush selectionTextBrush = new SolidColorBrush(SystemColors.HighlightTextColor);
selectionTextBrush.Freeze();
return selectionTextBrush;
}
```

**Actual behavior:**
The selected text still black.

**Expected behavior:**
The selected text should be red.
**Minimal repro:**
```xaml
```
Contributor guide
Assessment
This issue has not been assessed yet.