private void SetupFocus()
 {
     if (string.IsNullOrEmpty(ViewModel.Username))
     {
         UserTextBox.Focus(FocusState.Programmatic);
     }
     else if (string.IsNullOrEmpty(ViewModel.Host))
     {
         HostTextBox.Focus(FocusState.Programmatic);
     }
     else
     {
         Focus(FocusState.Programmatic);
     }
 }
Example #2
0
        private void SetupFocus()
        {
            SshProfileViewModel vm = (SshProfileViewModel)DataContext;

            if (string.IsNullOrEmpty(vm.Username))
            {
                UserTextBox.Focus(FocusState.Programmatic);
            }
            else if (string.IsNullOrEmpty(vm.Host))
            {
                HostTextBox.Focus(FocusState.Programmatic);
            }
            else
            {
                Focus(FocusState.Programmatic);
            }
        }