// NameText private void NameEditText_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Return) { NameTextBox.EndEditing(); Keyboard.ClearFocus(); } }