I assume you mean to ask how to set the focus back to textBox1 if the text is empty. To do this you need to handle the
PreviewLostKeyboardFocus
event. There you check if textbox is empty and if so set
e.handled
to true like this:-
<TextBox Name="textBox1" PreviewLostKeyboardFocus="textBox1_PreviewLostKeyboardFocus" />
private void textBox1_PreviewLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (textBox1.Text == string.Empty)
{
e.Handled = true;
}
}
Hope this helps