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); } }
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); } }