public virtual void Select(string text) { ListViewRows rows = Rows; ListViewRow row = rows.Find(obj => obj.Cells[0].Text.Equals(text)); if (row == null) { throw new UIActionException("Could not find suggestion " + text); } row.Select(); SuggestionListView.WaitTillNotPresent(); actionListener.ActionPerformed(Action.WindowMessage); }
private void AutoSuggestBox_KeyDown(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e) { // Checks if the comma key was pressed (code 188) if ((int)e.Key == 188 || e.Key == Windows.System.VirtualKey.Enter) { e.Handled = true; ViewModel.TagSubmittedCommand.Execute(null); (sender as TextBox).Text = string.Empty; } else if (e.Key == Windows.System.VirtualKey.Up && ViewModel.Tags.Count > 0) { TagsListView.Focus(Windows.UI.Xaml.FocusState.Programmatic); } else if (e.Key == Windows.System.VirtualKey.Down && ViewModel.Suggestions.Count > 0) { SuggestionListView.Focus(Windows.UI.Xaml.FocusState.Programmatic); } }