If there's an event that deselects text during the OnFocus
mouse up, I usually just delay the select all.
private void TextBox_GotFocus(object sender, RoutedEventArgs e)
{
if (TextBox.Text != null)
{
_ = Task.Run(() =>
{
Dispatcher.Invoke(
async () => {
await Task.Delay(100);
TextBox.SelectAll();
}
);
});
}
}