private void ApplyFilterInternal(AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { FilterCountries(Query); } }
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; }
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 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_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 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 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) { 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; } }
// 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_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"); } }
/// <summary> /// This event gets fired anytime the text in the TextBox gets updated. /// It is recommended to check the reason for the text changing by checking against args.Reason /// </summary> /// <param name="sender">The AutoSuggestBox whose text got changed.</param> /// <param name="args">The event arguments.</param> private void asb_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { // We only want to get results when it was a user typing, // otherwise we assume the value got filled in by TextMemberPath // or the handler for SuggestionChosen if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { var matchingContacts = ContactSampleDataSource.GetMatchingContacts(sender.Text); sender.ItemsSource = matchingContacts.ToList(); } }
private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { var searchTerm = sender.Text; var query = new Query(searchTerm); var result = algoliaIndex.SearchAsync(query).Result; var packagesResult = result.ToObject<PackagesResult>(); sender.ItemsSource = packagesResult.hits; } }
private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { // TODO: not being called from flyout if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { Suggestions.Clear(); foreach (var Item in AllItems) { if (Item.Title.IndexOf(sender.Text, StringComparison.OrdinalIgnoreCase) >= 0) { Suggestions.Add(Item); } } } }
private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { // Set a threshold when to start looking for suggestions if (sender.Text.Length >= 1) { sender.ItemsSource = getSuggestions(sender.Text); } else { sender.ItemsSource = new List<String> { }; } } }
/// <summary> /// This event gets fired anytime the text in the TextBox gets updated. /// It is recommended to check the reason for the text changing by checking against args.Reason /// </summary> /// <param name="sender">The AutoSuggestBox whose text got changed.</param> /// <param name="args">The event arguments.</param> private async void Control2_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { //We only want to get results when it was a user typing, //otherwise we assume the value got filled in by TextMemberPath //or the handler for SuggestionChosen if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { var suggestions = await SearchControls(sender.Text); if (suggestions.Count > 0) sender.ItemsSource = suggestions; else sender.ItemsSource = new string[] { "No results found" }; } }
private void OnTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput && sender.Text.Length >= 2) { string input = sender.Text; var q = _racers.Where(r => r.FirstName.StartsWith(input, StringComparison.CurrentCultureIgnoreCase)).OrderBy(r => r.FirstName).ThenBy(r => r.LastName).ThenBy(r => r.Country).ToArray(); if (q.Length == 0) { q = _racers.Where(r => r.LastName.StartsWith(input, StringComparison.CurrentCultureIgnoreCase)).OrderBy(r => r.LastName).ThenBy(r => r.FirstName).ThenBy(r => r.Country).ToArray(); if (q.Length == 0) { q = _racers.Where(r => r.Country.StartsWith(input, StringComparison.CurrentCultureIgnoreCase)).OrderBy(r => r.Country).ThenBy(r => r.LastName).ThenBy(r => r.FirstName).ToArray(); } } sender.ItemsSource = q; } }
/// <summary> /// Automates the suggest box search room_ on text changed. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="AutoSuggestBoxTextChangedEventArgs" /> instance containing the event data.</param> private void AutoSuggestBoxSearchRoom_OnTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { //if reason for text changed was not user input, ignore. if (args.Reason != AutoSuggestionBoxTextChangeReason.UserInput) { return; } //text inputed by user string textChanged = sender.Text; //find all rooms with the matching inputed text var matchingRooms = MapSearcher.SearchForRoomAsync(textChanged); //set the autosuggestbox to show all matching rooms AutoSuggestBoxSearchRoom.ItemsSource = matchingRooms; }
private void ServiceSearchQueryChanged( AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { var searchQuery = sender.Text; if (string.IsNullOrEmpty(searchQuery)) { ServicesSearchBox.ItemsSource = null; return; } var currentServices = ConcreteDataContext.Services; var suggestions = currentServices.Where( service => service.ServiceName.IndexOf( searchQuery, StringComparison.CurrentCultureIgnoreCase) >= 0).ToList(); if (suggestions.Count > 0) { SetSearchBoxMemberPath(nameof(ServiceInformation.ServiceName)); ServicesSearchBox.ItemsSource = suggestions.OrderByDescending( serviceInformation => serviceInformation.ServiceName.StartsWith( searchQuery, StringComparison.CurrentCultureIgnoreCase)) .ThenBy(serviceInformation => serviceInformation.ServiceName) .ToArray(); } else { SetSearchBoxMemberPath(string.Empty); ServicesSearchBox.ItemsSource = new[] { "No results found" }; } } }
private async void controlsSearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { var groups = await AppUIBasics.Data.ControlInfoDataSource.GetGroupsAsync(); var suggestions = new List<ControlInfoDataItem>(); foreach (var group in groups) { var matchingItems = group.Items.Where( item => item.Title.IndexOf(sender.Text, StringComparison.CurrentCultureIgnoreCase) >= 0); foreach (var item in matchingItems) { suggestions.Add(item); } } if (suggestions.Count > 0) controlsSearchBox.ItemsSource = suggestions.OrderByDescending(i => i.Title.StartsWith(sender.Text, StringComparison.CurrentCultureIgnoreCase)).ThenBy(i => i.Title); else controlsSearchBox.ItemsSource = new string[] { "No results found" }; } }
private void TagSearchInput_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { SearchService service = new SearchService(); ImageGallery.ItemsSource = service.SearchImages(this.previewImages, TagSearchInput.Text); }
private async void RequestLocation(object sender, RoutedEventArgs e) { Getloc1.Visibility = Visibility.Collapsed; Getloc2.Visibility = Visibility.Collapsed; Gethome1.Visibility = Visibility.Collapsed; Gethome2.Visibility = Visibility.Collapsed; if (((Button)sender).Name == "Getloc1") { locprogress1.Visibility = Visibility.Visible; From.Focus(FocusState.Programmatic); } else { locprogress2.Visibility = Visibility.Visible; To.Focus(FocusState.Programmatic); } bool isallowed = false; if ((bool?)localSettings.Values["location"] != false) { isallowed = await Utilities.LocationFinder.IsLocationAllowed(); if (isallowed) { string town = await Utilities.LocationFinder.GetLocation(); if (town != null) { var arg = new AutoSuggestBoxTextChangedEventArgs(); arg.Reason = AutoSuggestionBoxTextChangeReason.UserInput; if (((Button)sender).Name == "Getloc1") { From.Text = town; InputChanged(From, arg); } else { To.Text = town; InputChanged(To, arg); } } else { var dialog = new MessageDialog(resourceLoader.GetString("LocationError")); dialog.Commands.Add(new UICommand("OK")); dialog.DefaultCommandIndex = 0; await dialog.ShowAsync(); } } } if ((bool?)localSettings.Values["location"] == false || !isallowed) { var dialog = new MessageDialog(resourceLoader.GetString("LocationDisabled")); dialog.Commands.Add(new UICommand("OK")); dialog.Commands.Add(new UICommand(resourceLoader.GetString("Settings"), (command) => { Frame.Navigate(typeof(Settings)); })); dialog.CancelCommandIndex = 0; dialog.DefaultCommandIndex = 1; await dialog.ShowAsync(); } Getloc1.Visibility = Visibility.Visible; Getloc2.Visibility = Visibility.Visible; Gethome1.Visibility = Visibility.Visible; Gethome2.Visibility = Visibility.Visible; locprogress1.Visibility = Visibility.Collapsed; locprogress2.Visibility = Visibility.Collapsed; }
private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { errlog.Text = ""; }
/// <summary> Handles the TextChanged event of the AutoSuggestBox.</summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="AutoSuggestBoxTextChangedEventArgs"/> instance containing the event data.</param> private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { FilterTheList(sender.Text); }
private void SearchAutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { SoundManager.GetAllSounds(Sounds); Suggestions = Sounds.Where(p => p.Name.StartsWith(sender.Text)).Select(p => p.Name).ToList(); SearchAutoSuggestBox.ItemsSource = Suggestions; }
private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { //var Auto = (AutoSuggestBox)sender; //Auto.ItemsSource = th }
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; }
/// <summary> /// When the Person textBoxses are changed (Director, Writer, Actor Star) /// it will post a httpPostRequest to the api. /// This will check for any FirstNames matching with the rows in the Person Table. /// The api returns a list with all matching Persons. This list is presented in an autoSuggestionBox /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="AutoSuggestBoxTextChangedEventArgs"/> instance containing the event data.</param> /// <returns>Void. However it writes to the suggestionbox sender</returns> private async void AutoSuggestBox_Person_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) { //Clearing all suggestions suggestions.Clear(); //Does not add suggestions if user hasn't typed anything. if (sender.Text.Length < 1) { return; } //Fetching the text input string currentSearch = sender.Text; //Making ready for HttpPost string jsonInput = JsonConvert.SerializeObject(currentSearch); var client = new HttpClient(); try { //Defining the api link string uri = "http://localhost:59713/api/People/search"; //sending postRequest var httpResponse = await client.PostAsync(uri, new StringContent(jsonInput, Encoding.UTF8, "application/json")); //Checking the post response if (httpResponse.Content != null) { //Reading as string var json = await httpResponse.Content.ReadAsStringAsync(); //Clearing all suggestions suggestions.Clear(); //Itterating through the response dyamically so that it will fetch the item parameters at runtime dynamic dynJson = JsonConvert.DeserializeObject(json); foreach (var item in dynJson) { suggestions.Add("" + item.personId + ": " + item.firstName + " " + item.lastName); } //If there are no items in the response if (!suggestions.Any()) { suggestions.Add("No Results"); } //Adding the new suggestion to the autosuggestionbox sender.ItemsSource = suggestions; } } //If something goes wrong while fetching the Search items catch { await new MessageDialog("Could not fetch", "Response").ShowAsync(); } } }
private void suggestionBox_OnTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { Element.Text = Control.Text; }
private void SearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { // search suggestions with updated query }
internal void RaiseTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { TextChanged?.Invoke(sender, args); }
private void NaamFilter_Changed(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { naamFilter = NaamFilter.Text.ToLower(); filterLijst(); }
private async void InputChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (From.Text == "" || To.Text == "") { AppbarGo.IsEnabled = false; #if WINDOWS_UWP SearchButton.IsEnabled = false; #endif } else { AppbarGo.IsEnabled = true; #if WINDOWS_UWP SearchButton.IsEnabled = true; #endif } if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { string input = sender.Text; List <Dictionary <string, string> > stops = await Utilities.Autocomplete.GetSuggestions(input, selectedDate); if (sender.Name == "From") { stops1.Clear(); stops1 = stops; } else { stops2.Clear(); stops2 = stops; } List <string> suggestions = new List <string>(); if (sender.Name == "From") { searchterm1 = input; foreach (Dictionary <string, string> stop in stops1) { string temp; stop.TryGetValue("Nev", out temp); if (!temp.Contains(" vá.") && !temp.Contains(" vmh.")) { suggestions.Add(temp); } } } else { searchterm2 = input; foreach (Dictionary <string, string> stop in stops2) { string temp; stop.TryGetValue("Nev", out temp); if (!temp.Contains(" vá.") && !temp.Contains(" vmh.")) { suggestions.Add(temp); } } } sender.ItemsSource = suggestions; } }
private void server_asbx_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { showServersFiltered(server_asbx.Text); browse_btn.IsEnabled = Utils.isValidServerAddress(server_asbx.Text); }
private void SearchBox_OnTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { Vm.SearchUpdateCommand.Execute(); }
/*** Find controls **/ private void findBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) => FindAndHighLightAllOccurrence(sender.Text);
private void MyAutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { sender.ItemsSource = selectionItems.Where(s => s.StartsWith(sender.Text)).ToArray(); }
/***Replace Control***/ private void replaceBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { }
private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { viewModel.FilterChanged(sender.Text); }
private void SuggestionsTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { var suggestions = new List<string> { "A1", "A2", "A3" }; sender.ItemsSource = suggestions; } }
private void SearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { UpdateSearchSuggestions(); }
private async void SearchText_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { String value = sender.Text; if (value.Length < 2) return; if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { Task<List<Facet>> listTask = FacetGroup.getFacets(value, gender); List<Facet> list = await listTask; sender.ItemsSource = list; } }
private void SearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { }
private void SearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { ViewModel.LoadTipAsync(sender.Text); }
private void txtSearch_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { txtSearch.ItemsSource = listkh.Where(kh => kh.StartsWith(txtSearch.Text, StringComparison.OrdinalIgnoreCase)).ToArray(); }
private void searchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { MovieDataGrid.ItemsSource = from movie in Movies where movie.Title.Contains(searchBox.Text, StringComparison.OrdinalIgnoreCase) select movie; }
//verifie si le text de la suggest box a changer et lance la recherche de propositions private async void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { List<string> list = new List<string>(); if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { //Set the ItemsSource to be your filtered dataset try { Debug.WriteLine("debut recup list :"); Debug.WriteLine(adressSugest.Text); list = await addressList(sender.Text); Debug.WriteLine("reussi"); sender.ItemsSource = list; } catch { Debug.WriteLine(list); Debug.WriteLine("Fail recuplist"); } //sender.ItemsSource = dataset; } }
// 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; } }
private void Suggest_Textchanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { //var vm = DataContext as AddNewHistoryViewModel; if (args.Reason == AutoSuggestionBoxTextChangeReason.SuggestionChosen) { return; } var x = new ObservableCollection<Category>(GetFakeRuntimeItems()); ObservableCollection<string> myList = new ObservableCollection<string>(); foreach (var myString in x) { if (myString.name.Contains(sender.Text) == true) { myList.Add(myString.name); } } AutoSuggestBox.ItemsSource = myList; }
private void FilteringTextBox_TextChanged_1(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { _advancedCollectionView.RefreshFilter(); }
private void AlteracaoTexto(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { string strFiltro = sender.Text.ToUpper(); CaixaTexto.ItemsSource = ListaSugestoes.Where(s => s.ToUpper().Contains(strFiltro)); }
private void asbName_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { ViewModel.ProjectName = sender.Text; ViewModel.UpdataSearchProject(); }
private void AutoSuggestBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { _searching = true; Data.Search(sender.Text); _searching = false; }
private void textBox3_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { }
/// <summary> /// Fired when the text is changed in the suggestion text box. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void SubredditSuggestBox_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) { // First get the list if we don't have it if(m_currentSubreddits == null) { m_currentSubreddits = App.BaconMan.SubredditMan.SubredditList; } // Do a simple starts with search for things that match the user's query. List<string> filteredSubreddits = new List<string>(); string userStringLower = ui_subredditSuggestBox.Text.ToLower(); foreach (Subreddit sub in m_currentSubreddits) { if(!sub.IsArtifical && sub.DisplayName.ToLower().StartsWith(userStringLower)) { filteredSubreddits.Add(sub.DisplayName); } if(filteredSubreddits.Count > 4) { break; } } // Set the new suggestions ui_subredditSuggestBox.ItemsSource = filteredSubreddits; } }
private void SeachTextBox2_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { Seach_text = SeachTextBox.Text; GetTagAsync(); SeachTextBox.ItemsSource = Tag_yande; }