private void OnBankBalanceGotFocus(object sender, RoutedEventArgs e) { var textBox = e.OriginalSource as TextBox; if (textBox != null) { textBox.SelectAll(); } }