private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { ForView.Unwrap<SubscriptionViewModel>(DataContext, vm => { vm.QuerySubmitted(); }); }
private void searchAutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (string.IsNullOrEmpty(sender.Text)) goBack(); SoundManger.GetAllSounds(Sounds); Suggestions = Sounds.Where(p => p.Name.StartsWith(sender.Text)).Select(p=>p.Name).ToList(); searchAutoSuggestBox.ItemsSource = Suggestions; }
/// <summary>Initializes a new instance of the <see cref="SearchHamburgerItem"/> class.</summary> public SearchHamburgerItem() { AutoSuggestBox = new AutoSuggestBox(); AutoSuggestBox.QueryIcon = new SymbolIcon { Symbol = Symbol.Find }; AutoSuggestBox.AutoMaximizeSuggestionArea = false; AutoSuggestBox.Loaded += delegate { AutoSuggestBox.PlaceholderText = PlaceholderText; }; AutoSuggestBox.QuerySubmitted += OnQuerySubmitted; AutoSuggestBox.GotFocus += OnGotFocus; Content = AutoSuggestBox; Icon = new SymbolIcon(Symbol.Find); CanBeSelected = false; ShowContentIcon = false; PlaceholderText = string.Empty; Click += (sender, args) => { args.Hamburger.IsPaneOpen = true; args.Hamburger.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { AutoSuggestBox.Focus(FocusState.Programmatic); }); }; }
private void Searchbox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { if (!string.IsNullOrWhiteSpace(args.QueryText)) { this.RootFrame?.NavigateAsync(typeof(Views.SearchPage), args.QueryText); } }
private async void ui_search_autosuggestboxFrom_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { string stationSearchedFor = args.QueryText; if (string.IsNullOrWhiteSpace(stationSearchedFor) || stationSearchedFor.Length <= 3) { //user did not input more than three letters FromStopLocations.Clear(); _fromId = ""; //dirty way to show error message const string noResults = "Skriv mer än tre bokstäver..."; StopLocation notCorrectEntry = new StopLocation { name = noResults }; FromStopLocations.Add(notCorrectEntry); IsReadyForSearch(); //add to autosuggestionbox ui_search_autosuggestboxFrom.ItemsSource = FromStopLocations; return; } else { //user searched for new station, clear list from old stations. FromStopLocations.Clear(); //call api to get stations from user inputted text await ApiCaller.SearchForStationAsync(FromStopLocations, stationSearchedFor); //populate autosuggestionbox ui_search_autosuggestboxFrom.ItemsSource = FromStopLocations; } }
private async void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { try { if (sender.Text.Length != 0) { //ObservableCollection<String> var data = new ObservableCollection<string>(); var httpclient = new Noear.UWP.Http.AsyncHttpClient(); httpclient.Url("http://mobilecdn.kugou.com/new/app/i/search.php?cmd=302&keyword="+sender.Text); var httpresult = await httpclient.Get(); var jsondata = httpresult.GetString(); var obj = Windows.Data.Json.JsonObject.Parse(jsondata); var arryobj = obj.GetNamedArray("data"); foreach (var item in arryobj) { data.Add(item.GetObject().GetNamedString("keyword")); } sender.ItemsSource = data; //sender.IsSuggestionListOpen = true; } else { sender.IsSuggestionListOpen = false; } } catch (Exception) { } }
private void OnQuerySubmitted(AutoSuggestBox box, AutoSuggestBoxQuerySubmittedEventArgs args) { AutoSuggestBox.Text = ""; var hamburger = box.GetVisualParentOfType<Hamburger>(); hamburger.IsPaneOpen = false; }
private async void asbox_Search_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { Func<HPUserDetail, string> f = h => h.ou; setWorking(true); string searchText = args.ChosenSuggestion == null ? args.QueryText : args.ChosenSuggestion.ToString(); SearchInfo result = null; try { result = await PeopleFinderHelper.Search(searchText); tbl_Msg.Text = ""; } catch(Exception ex) { tbl_Msg.Text = ex.Message; } var myResult = result?.result.GroupBy(g => new { g.co, g.c}).OrderBy(o => o.Key.co).Select(gu => new PeopleFinderViewModel() { Group = gu.Key.co,SecondGroup=gu.Key.c, Peoples = gu.ToList() }); ViewModel = myResult; this.Bindings.Update(); setWorking(false); }
/// <summary> /// Invoked when a custom name is entered for a list item. /// </summary> /// <param name="sender">The name entry box</param> /// <param name="args">Event arguments</param> private void nameBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { var vm = DataContext as Favourites; var platform = sender.DataContext as DataStorage.Favourite; vm.ChangeCustomName(platform.PlatformNo, sender.Text); this.editFlyout.Hide(); }
private void SearchAutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { SoundManager.GetSoundsByName(Sounds, sender.Text); CategoryTextBlock.Text = sender.Text; MenuItemsListView.SelectedItem = null; BackButton.Visibility = Visibility.Visible; }
private async void FromStationText_OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { string textSubmitted = args.QueryText; //query from user if (textSubmitted.Length > 3) { //user searched for new station, clear list from old stations. FromStopLocations.Clear(); //call api to get stations from user inputted text Task t = ApiCaller.PopulateStopLocationsAsync(FromStopLocations, textSubmitted); await t; //populate autosuggestionbox fromStationText.ItemsSource = FromStopLocations; IsReadyForSearch(); } else { //user did not input more than three letters FromStopLocations.Clear(); //dirty way to show error message string noResults = "Skriv mer än tre bokstäver..."; var notCorrectEntry = new StopLocation {name = noResults}; FromStopLocations.Add(notCorrectEntry); //add to autosuggestionbox fromStationText.ItemsSource = FromStopLocations; } }
private void SearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { if (sender.Text.Length > 0) { SearchResultPanel.StartSearch(Frame, sender.Text); } }
private void XmppDomainSuggest_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { viewModel.XmppDomainSuggestions = new ObservableCollection<string>(viewModel.baseDomainSuggestions.Where(p => p.Contains(XmppDomainSuggest.Text))); } }
private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { ForView.Unwrap<SearchViewModel>(DataContext, vm => { vm.QuerySubmitted(); }); ResultsList.Focus(FocusState.Keyboard); }
/// <summary> /// 发表回应 /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void MyComment_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { if (!MyComment.Text.Equals("")) { _totalHtml = _totalHtml.Replace("<a id='ok'></a>", "") + ChatBoxTool.Send("http://pic.cnblogs.com/avatar/624159/20150505133758.png", "青柠檬", MyComment.Text, DateTime.Now.ToString()) + "<a id='ok'></a>"; FlashComment.NavigateToString(_totalHtml); } }
private void suggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.CheckCurrent()) { var term = suggestBox.Text.ToLower(); var results = news.Where(i => i.Title.Contains(term)).ToList(); suggestBox.ItemsSource = results; } }
private void AutoSuggestBox_OnTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { myManaApartmentManger.GetAllApartments(apartments); Suggestions = apartments .Where(p => p.ApartmentCity.ToString().ToLower().StartsWith(sender.Text)) .Select(p => p.ApartmentCity.ToString()).Distinct() .ToList(); AutoSuggestBox.ItemsSource = Suggestions; }
private void StationsBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { sender.ItemsSource = (sender.Text.Length > 0) ? stationsData.Where(x => x.StartsWith(sender.Text, StringComparison.OrdinalIgnoreCase)) : new string[] { }; } }
private void FoundServiceSubmitted( AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { var choosenService = (args.ChosenSuggestion as ServiceInformation); if (choosenService != null) { ConcreteDataContext.NavigateToService.Execute(choosenService); } }
private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { Suggestions.Clear(); Suggestions.Add(sender.Text + "1"); Suggestions.Add(sender.Text + "2"); } Control1.ItemsSource = Suggestions; }
private void alimentInput_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { //sender.ItemsSource = fakeDB.Where(s => s.Contains(sender.Text)); alimlist = getAlimListFromDB(sender.Text); sender.ItemsSource = alimlist; } }
private async void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { string message = $"query: {args.QueryText}"; if (args.ChosenSuggestion != null) { message += $" suggestion: {args.ChosenSuggestion}"; } var dlg = new MessageDialog(message); await dlg.ShowAsync(); }
private async void searchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if(searchBox.Text.Length >= 3 && args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { string[] addedTags = searchBox.Text.Split(searchBoxTagSeparator); string partialTag = addedTags[addedTags.Length - 1]; System.Collections.Generic.List<Common.Model.Tag> tagset = await Common.Search.TagSearch.FetchTags(partialTag); searchBox.ItemsSource = tagset; } }
private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { var txt = ((AutoSuggestBox)sender).Text; if (txt != " " && txt != "") { App.CurrentSearchWord = txt; searchDocListView.ItemsSource = new IncrementalLoadingCollection<SearchDocSource, Document>(10); } }
private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { // Only get results when it was a user typing, // otherwise assume the value got filled in by TextMemberPath // or the handler for SuggestionChosen. if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { //Set the ItemsSource to be your filtered dataset //sender.ItemsSource = dataset; } }
private void AutoSuggestBoxPostalCodes_OnTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { var vm = this.DataContext as SearchFormViewModel; if (null != vm) { var suggestions = vm.SuggessedPostalCodeList; string filter = sender.Text.ToUpper(); AutoSuggestBoxPostalCodes.ItemsSource = suggestions.Where(s => s.Contains(filter)); } }
private void suggestions_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { Suggestions.Clear(); Suggestions.Add(sender.Text + "1"); Suggestions.Add(sender.Text + "2"); Suggestions.Add(sender.Text + "3"); Suggestions.Add(sender.Text + "4"); } }
private void searchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { if (args.ChosenSuggestion == null) { string[] temp = searchBox.Text.TrimEnd(searchBoxTagSeparator).Split(searchBoxTagSeparator); System.Collections.Generic.List<string> tagsList = new System.Collections.Generic.List<string>(); foreach (string tag in temp) tagsList.Add(tag.Replace(' ','_').Trim('"')); Shell.ContentFrame.Navigate(typeof(SearchResultsPage), tagsList); } }
// Event handler when user is typing a search query, show a list of suggestions private void SearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { //We only want to get results when it was a user typing if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { var matchingEvents = EventController.GetMatchingEvents(events, sender.Text); RefreshEventList(sender.Text); sender.ItemsSource = matchingEvents.ToList(); } }
private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { if (args.ChosenSuggestion != null) { // User selected an item from the suggestion list, take an action on it here. } else { // Use args.QueryText to determine what to do. } }
/*** Find controls **/ private void findBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) => FindAndHighLightAllOccurrence(sender.Text);
private void SearchAutoBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args) { SearchAutoSuggestBox.Text = (args.SelectedItem as LittleAnimal).Name; }
private void auto_suggest_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { }
private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { //var Auto = (AutoSuggestBox)sender; //Auto.ItemsSource = th }
private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { (sender.DataContext as SearchViewModel).SearchCommand.Execute("default"); }
private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { var query = args.QueryText; ContentFrame.Navigate(typeof(SearchView), query); }
private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { _searching = true; Data.Search(sender.Text); _searching = false; }
private void asbName_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { ViewModel.ProjectName = sender.Text; ViewModel.UpdataSearchProject(); }
private void FilteringTextBox_TextChanged_1(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { _advancedCollectionView.RefreshFilter(); }
private async void OnPersonNameQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { await this.AddPerson(args.ChosenSuggestion != null?args.ChosenSuggestion.ToString() : args.QueryText); }
private void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { QuerySubmitted?.Invoke(sender, args); }
private void SearchAutoSuggestBox_OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { }
}//END getSuggestions private void SearchboxSearch(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { suggestBox.ItemsSource = null; SearchAsync(sender.Text); }
private void AutoSuggestBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args) { sender.Text = (args.SelectedItem as EmojiData).Name; }
private void Username_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args) { sender.Text = args.SelectedItem?.ToString(); }
// observe if query is submitted from search box private void SearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { SearchQuery(args.QueryText); }
private void MyAutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { sender.ItemsSource = selectionItems.Where(s => s.StartsWith(sender.Text)).ToArray(); }
private void textBox3_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { }
/***Replace Control***/ private void replaceBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { }
private void textBox3_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { }
private void CommandTextBox_OnSuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args) { _lastChosenCommand = (args.SelectedItem as CommandItemViewModel)?.ExecutedCommand; }
// AUTOSUGGEST text in the box has changed private void TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { // Only get results when it was a user typing, if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { //Set the ItemsSource to be your filtered dataset //sender.ItemsSource = dataset; // ALGORITHM // - we will prioritise substrings of the available search // - after that we will add the lowest levenshtein distance results up to a constant // - max 8 List <string> matched = new List <string>(); string source = sender.Text; int results = 0; // go though each member of the contacts and check it foreach (string test in searchable_contacts) { // if the contact contains what weve typed do far if (test.Contains(source)) { matched.Add(test); results++; } // if we have enough get out if (results > 5) { break; } } // if we're running out of results we can get some with small errors if (results < 5) { // go though each member of the contacts and check it foreach (string test in searchable_contacts) { // we want to check only up to the characters that have been typed string test_s; try { test_s = test.Substring(0, source.Length); } catch (ArgumentOutOfRangeException) { // the search text is longer than the name oh well test_s = test; } // if the difference number is less than 3 and its not already in if (LevenshteinDistance(source, test_s) < 3 && !matched.Contains(test)) { matched.Add(test); results++; } // if we have enough get out if (results > 7) { break; } } } sender.ItemsSource = matched; } }
// TEXT CHANGED ON SEARCH BOX private void SearchAutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { goBack(); }
// AUTOSUGGEST one of the suggestions is chosen/ highlighted private void SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args) { // Set sender.Text. You can use args.SelectedItem to build your text string. sender.Text = args.SelectedItem.ToString(); }
private void AutoSuggestBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args) { }
private void txtSearch_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { txtSearch.ItemsSource = listkh.Where(kh => kh.StartsWith(txtSearch.Text, StringComparison.OrdinalIgnoreCase)).ToArray(); }
public PokedexPage() { InitializeComponent(); // Observe changes on state Store.Select( CombineSelectors(SelectLoading, SelectIsPokedexEmpty) ) .ObserveOnDispatcher() .Subscribe(x => { var(loading, isPokedexEmpty) = x; OpenPokedexButton.ShowIf(!loading && isPokedexEmpty); GlobalLoadingProgressRing.IsActive = loading && isPokedexEmpty; GlobalLoadingProgressRing.ShowIf(loading && isPokedexEmpty); RootStackPanel.ShowIf(!isPokedexEmpty); }); Store.Select(SelectSuggestions, 5) .ObserveOnDispatcher() .Subscribe(suggestions => { AutoSuggestBox.ItemsSource = suggestions; }); Store.Select(SelectPokemon) .ObserveOnDispatcher() .Subscribe(pokemon => { PokemonPanel.ShowIf(pokemon.HasValue); PokemonIdTextBlock.Text = pokemon.HasValue ? $"#{pokemon.Value.Id}" : string.Empty; PokemonNameTextBlock.Text = pokemon.HasValue ? pokemon.Value.Name : string.Empty; PokemonImage.Source = pokemon.HasValue ? new BitmapImage(new Uri(pokemon.Value.Image)) : null; }); Store.Select(SelectErrors) .ObserveOnDispatcher() .Subscribe(errors => { ErrorsListView.ItemsSource = errors; }); // Observe UI events OpenPokedexButton.Events().Click .ObserveOnDispatcher() .Subscribe(_ => Store.Dispatch(new GetPokemonListAction())); AutoSuggestBox.Events().TextChanged .ObserveOnDispatcher() .Subscribe(_ => { Store.Dispatch(new UpdateSearchStringAction { Search = AutoSuggestBox.Text }); }); AutoSuggestBox.Events().SuggestionChosen .ObserveOnDispatcher() .Subscribe(e => { var selectedPokemonOption = (e.SelectedItem as PokemonGeneralInfo).ToOption(); if (selectedPokemonOption.HasValue) { AutoSuggestBox.Text = selectedPokemonOption.Value.Name; // Avoid the automatic change of the Text property of SuggestBox Store.Dispatch(new UpdateSearchStringAction { Search = selectedPokemonOption.Value.Name }); } }); // Register Effects Store.RegisterEffects( LoadPokemonList, LoadPokemonById, SearchPokemon ); // Initialize Documentation DocumentationComponent.LoadMarkdownFilesAsync("Pokedex"); GoToGitHubButton.Events().Click .Subscribe(async _ => { var uri = new Uri("https://github.com/Odonno/ReduxSimple/tree/master/ReduxSimple.Samples/Pokedex"); await Launcher.LaunchUriAsync(uri); }); OpenDevToolsButton.Events().Click .Subscribe(async _ => { await Store.OpenDevToolsAsync(); }); ContentGrid.Events().Tapped .Subscribe(_ => DocumentationComponent.Collapse()); DocumentationComponent.ObserveOnExpanded() .Subscribe(_ => ContentGrid.Blur(5).Start()); DocumentationComponent.ObserveOnCollapsed() .Subscribe(_ => ContentGrid.Blur(0).Start()); }
private void SearchAutoSuggestBox_OnTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { var suggestion = Words.Where(x => x.Value.StartsWith(sender.Text) || x.Value.StartsWith(sender.Text.ToLower()) || x.Value.StartsWith(sender.Text.ToUpper())).Select(x => x.Key).ToList(); SearchAutoSuggestBox.ItemsSource = suggestion; }
private void FilteringTextBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) { ItemsList.SelectedItem = args.ChosenSuggestion; ItemsList.ScrollIntoView(args.ChosenSuggestion, ScrollIntoViewAlignment.Leading); }
private void CBoxLotNums_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args) { SelectedLot = args.SelectedItem as LotItem; sender.Text = SelectedLot.Code; }