private void InviteCodeButton_TextChanged(object sender, TextChangedEventArgs e) { if (string.IsNullOrWhiteSpace(((TextBox)sender).Text)) { return; } var person = _mockedData.FindPerson(Convert.ToInt32(((TextBox)sender).Text)); /* * -1 means the person was not located */ if (person.Id > -1) { // Enabling group enables child controls GroupGrid.IsEnabled = true; // This will automatically select the first control in the tab order MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); FirstNameTextBox.Text = person.FirstName; LastNameTextBox.Text = person.LastName; FirstNameTextBox.Select(person.FirstName.Length, 0); } else { GroupGrid.IsEnabled = false; } }
private void NewPersonTab_Enter(object sender, EventArgs e) { FirstNameTextBox.Select(); }