Используйте событие GettingFocus и свойство PlaceholerText.
private void TextBox_GettingFocus(UIElement sender, GettingFocusEventArgs args)
{
var textbox = (sender as TextBox);
textbox.PlaceholderText = textbox.Text;
textbox.Text = "";
}
Используйте событие LosingFocus, чтобы определить, изменился ли текст, а если текст не изменился, восстановить старый текст.
private void TextBox_LosingFocus(UIElement sender, LosingFocusEventArgs args)
{
var textbox = (sender as TextBox);
// if the user didnt change the text, restore the old text input
if (textbox.Text == "")
{
textbox.Text = textbox.PlaceholderText;
textbox.PlaceholderText = "";
}
}