private void InputBox_OnKeyUp(object sender, KeyRoutedEventArgs e) { if (sender == PhoneNumberBox) { if (PhoneNumberBox.Text.Length == 10) { EmailBox.Focus(FocusState.Programmatic); return; } } if (e.Key == VirtualKey.Enter) { if (sender == NameBox) { SurnameBox.Focus(FocusState.Programmatic); } if (sender == SurnameBox) { CommandBar.Focus(FocusState.Programmatic); } else if (sender == EmailBox) { PasswordBox.Focus(FocusState.Programmatic); } else if (sender == PasswordBox) { PasswordRepeatBox.Focus(FocusState.Programmatic); } else if (sender == PasswordRepeatBox) { CommandBar.Focus(FocusState.Programmatic); } } }
public IWebElement Register(string name, string password) { WaitForElement(By.Id("UserName")); UserBox.Clear(); UserBox.SendKeys(name); WaitForElement(By.Id("Password")); PasswordBox.Clear(); PasswordBox.SendKeys(password); WaitForElement(By.Id("PasswordRepeat")); PasswordRepeatBox.Clear(); PasswordRepeatBox.SendKeys(password); WaitForElement(By.Id("Register")); RegisterButton.Click(); //wait for result page - Send the User back to the login page WaitForElement(By.Id("Login")); return(LoginElement); }