Пример #1
0
        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;
            }
        }
Пример #2
0
 private void NewPersonTab_Enter(object sender, EventArgs e)
 {
     FirstNameTextBox.Select();
 }