void OnTranslate(object sender, System.EventArgs e) { translatedNumber = PhonewordTranslator.ToNumber(EnteredNumber.Text); if (translatedNumber != null) { CallBtn.IsEnabled = true; CallBtn.Text = string.Format("Call {0}", translatedNumber); } else { DisplayAlert("Phoneword", "The number entered is unsupported, Please re-enter a number", "OK"); CallBtn.IsEnabled = false; EnteredNumber.Text = string.Empty; CallBtn.Text = "Call"; EnteredNumber.Focus(); } }
private void UserControl_Loaded(object sender, System.Windows.RoutedEventArgs e) { EnteredNumber.Focus(); }