In the Click-Event of your button, you can do something like
this.textBox.Focus();
If your lostfocus method looks like this:
private void UserName_LostFocus(object sender, RoutedEventArgs e){ ... }
you can prevent lost focus with the following code:
this.textBox.LostFocus -= UserName_LostFocus;
source share