private void StoresComplete_Populating(object sender, PopulatingEventArgs e) { var autoComplete = sender as AutoCompleteBox; e.Cancel = true; _viewModel.SearchForStore(autoComplete.Text); }
private void autocom_Populating(object sender, PopulatingEventArgs e) { string text = textBox1.Text; textBox1.ItemsSource = Names; _filterString = text; }
private void AutoComplete_Populating(object sender, PopulatingEventArgs e) { // Search for matching foods and make sure that the ServingSize information is returned FoodContext autocompleteContext = new FoodContext(); AutoComplete.ItemsSource = autocompleteContext.Foods; autocompleteContext.Load <FitnessTrackerPlus.Web.Data.Food>(autocompleteContext.SearchFoodsQuery(Globals.CurrentUser.id, Globals.MaxAutoCompleteResults, AutoComplete.Text, true), LoadBehavior.RefreshCurrent, (FoodsLoaded) => { if (!FoodsLoaded.HasError) { AutoComplete.PopulateComplete(); if (FoodsLoaded.TotalEntityCount == 0) { SearchingText.Text = "No foods found"; } } }, null); e.Cancel = true; }
private void MemberAutocomplete_Populating(object sender, PopulatingEventArgs e) { if (MemberAutocomplete.Text.Length > 2) { memberView.SearchForUser(MemberAutocomplete.Text); } }
protected override void OnPopulating(PopulatingEventArgs e) { try { if (!GameRes.VFS.IsVirtual) { var candidates = new List <string>(); string dirname = Path.GetDirectoryName(this.Text); if (!string.IsNullOrEmpty(dirname) && Directory.Exists(dirname)) { foreach (var dir in Directory.GetDirectories(dirname)) { if (dir.StartsWith(dirname, StringComparison.CurrentCultureIgnoreCase)) { candidates.Add(dir); } } } this.ItemsSource = candidates; } } catch { // ignore filesystem errors } base.OnPopulating(e); }
void HandleDirectoryAutoCompleteBoxPopulating(object sender, PopulatingEventArgs e) { var autoCompleteBox = (AutoCompleteBox)sender; string text = autoCompleteBox.Text; string[] subDirectories = Array.Empty <string>(); if (!string.IsNullOrWhiteSpace(text)) { string?directoryName = Path.GetDirectoryName(text); if (DirectoryUtil.ExistsOrNullIfTimeout(directoryName ?? text, TimeSpan.FromSeconds(2)) ?? false) { try { subDirectories = Directory.GetDirectories( directoryName ?? text, "*", SearchOption.TopDirectoryOnly); } catch { // ignore } } } autoCompleteBox.ItemsSource = subDirectories; autoCompleteBox.PopulateComplete(); }
private void WordAutoCompleteBox_OnPopulating(object sender, PopulatingEventArgs e) { var client = new PersonServiceSoapClient(); client.GetPersonsCompleted += GetPersonsCompleted; client.GetPersonsAsync(); }
private async void OnPopulatingAsynchronous(object sender, PopulatingEventArgs e) { AutoCompleteBox source = (AutoCompleteBox)sender; // Cancel the populating value: this will allow us to call // PopulateComplete as necessary. e.Cancel = true; usergroups = await global.webSocketClient.Query <apiuser>("users", @"{ name: {$regex: '" + source.Text.Replace("\\", "\\\\") + "', $options: 'i'} }"); //TestItems.Clear(); if (usergroups == null) { return; } // Use the dispatcher to simulate an asynchronous callback when // data becomes available _ = Dispatcher.BeginInvoke( new System.Action(delegate() { //source.ItemsSource = new string[] //{ // e.Parameter + "1", // e.Parameter + "2", // e.Parameter + "3", //}; //source.ItemsSource = TestItems.ToArray(); source.ItemsSource = usergroups; // Population is complete source.PopulateComplete(); })); }
private void txtClientes_Populating(object sender, PopulatingEventArgs e) { using (var bd = new EmpeñosDataContext()) txtClientes.ItemsSource = bd.Clientes .Where(c => c.Código.Contains(txtClientes.Text) || c.NombreCompleto.Contains(txtClientes.Text)) .Select(c => new KeyValuePair <string, string>(c.Código, c.NombreCompleto)).Take(10); }
/// <summary> /// Raises the Populating event when the AutoCompleteBox is populating the /// selection adapter with suggestions based on the text property. /// </summary> /// <param name="e">The populating event data.</param> protected virtual void OnPopulating(PopulatingEventArgs e) { PopulatingEventHandler handler = Populating; if (handler != null) { handler(this, e); } }
private void searchBox_Populating(object sender, PopulatingEventArgs e) { var recommendationWorker = new BackgroundWorker(); recommendationWorker.DoWork += recommendationWorker_DoWork; e.Cancel = true; recommendationWorker.RunWorkerAsync(searchBox.Text); }
private void tlACPeople_Populating(object sender, PopulatingEventArgs e) { string text = tlACPeople.Text; var result = _list.Where(p => p.Name.Contains(text)); tlACPeople.ItemsSource = result; tlACPeople.PopulateComplete(); }
private void tlACPeople_Populating(object sender, PopulatingEventArgs e) { string text = tlACPeople.Text; var count = _productProvider.CountFindProducts(text); var result = _productProvider.FindProducts(text); tlACPeople.ItemsSource = result; tlACPeople.PopulateComplete(); }
/// <summary> /// Starts the time of for the search box. After a period of time has elapsed /// without the user entering more keys the search will complete. /// </summary> /// <param name="sender">The calling object</param> /// <param name="e">Event arguments</param> private void searchBox_Populating(object sender, PopulatingEventArgs e) { AutoCompleteBox textBox = e.Source as AutoCompleteBox; if (textBox != null) { this.searchEntryTimer.Start(); } }
private void textbox_Populating(object sender, PopulatingEventArgs e) { e.Cancel = true; if (SearchTrie != null) { textbox.ItemsSource = SearchTrie.FindPrefix(e.Parameter); textbox.PopulateComplete(); } }
private void txtEndCustomer_Populating(object sender, PopulatingEventArgs e) { var ctx = new RadiographyContext(); if (RGReport != null) { ctx.GetEndCustomerNames(EndCustomerNames_Loaded, null); } }
private void txtArtículos_Populating(object sender, PopulatingEventArgs e) { using (var bd = new EmpeñosDataContext()) { txtArtículos.ItemsSource = bd.Artículos .Where(a => a.Estado == (byte)EstadosActículos.Quedado && (a.Código.Contains(txtArtículos.Text) || a.Nombre.Contains(txtArtículos.Text) || a.Artículos_Características.Any(ac => ac.Valor.Contains(txtArtículos.Text)))) .Select(a => new KeyValuePair <string, string>(a.Código, a.DescripciónExtendida)) .Take(15); } }
private void AutoCompleteBox_OnPopulating(object sender, PopulatingEventArgs e) { var autoCompleteBox = sender as AutoCompleteBox; if (autoCompleteBox != null) { this.ViewModel.SearchDiagnoses(autoCompleteBox.Text); } e.Cancel = true; }
/// <summary> /// The Populating event handler. /// </summary> /// <param name="sender">The source object.</param> /// <param name="e">The event data.</param> private void OnPopulatingSynchronous(object sender, PopulatingEventArgs e) { AutoCompleteBox source = (AutoCompleteBox)sender; source.ItemsSource = new string[] { e.Parameter + "1", e.Parameter + "2", e.Parameter + "3", }; }
private void AbPersonalAsistencial_OnPopulating(object sender, PopulatingEventArgs e) { var autoCompleteBox = sender as AutoCompleteBox; if (autoCompleteBox != null) { this.ViewModel.LoadPersonalAsistencial(new Tuple <string, string>(this.ViewModel.SelectedAgreement.Code, autoCompleteBox.Text)); } e.Cancel = true; }
private void AutoCompleteBox_Populating(object sender, PopulatingEventArgs e) { // Have we already populated with this text? if (People.Any(person => person.ToLower().StartsWith(e.Parameter.ToLower()))) { return; } Completer c = new Completer(); c.Completed += new EventHandler <EventArgs>(c_Completed); c.Complete(e.Parameter); }
/// <summary> /// Event triggered by typing from user /// </summary> /// <param name="sender">sender object</param> /// <param name="e">event arguments</param> private void Stops_Populating(object sender, PopulatingEventArgs e) { if (this.db == null) { // cancel populating e.Cancel = true; } SearchForStop(e.Parameter, sender); e.Cancel = true; }
void OnMetadataBoxPopulating(object sender, PopulatingEventArgs e) { var box = (AutoCompleteBox)sender; var encodeInfo = (EncodeInfo)box.DataContext; e.Cancel = true; CancellationToken token; Task <object[]> task = encodeInfo.StartQueryMetadata(box.SearchText, out token); task.ContinueWith(t => Dispatcher.BeginInvoke(UpdateQueryResults, box, t, token), token); }
private void AcNombreServicioPopulating(object sender, PopulatingEventArgs e) { var autoCompleteBox = sender as AutoCompleteBox; if (autoCompleteBox != null) { Debug.WriteLine("Iniciando Consulta..."); this.ViewModel.LoadSugestions(autoCompleteBox.Text); } e.Cancel = true; }
private async void SearchBox_OnPopulating(object sender, PopulatingEventArgs e) { var result = await App.ViewModel.GetDataSource().GetAutoCompleteSearchItems(SearchBox.Text); _autoCompleteItems.Clear(); foreach (var str in result) { _autoCompleteItems.Add(str); } SearchBox.PopulateComplete(); }
/// <summary> /// Handle and cancel the Populating event, and kick off the web service /// request. /// </summary> /// <param name="sender">The source object.</param> /// <param name="e">The event data.</param> private void Search_Populating(object sender, PopulatingEventArgs e) { var autoComplete = (AutoCompleteBox)sender; // Allow us to wait for the response e.Cancel = true; // Create a request for suggestion var wc = new WebClient(); wc.DownloadStringCompleted += OnDownloadStringCompleted; wc.DownloadStringAsync(WebServiceHelper.CreateWebSearchSuggestionsUri(autoComplete.SearchText), autoComplete); }
private void HandlePopulating(object sender, PopulatingEventArgs e) { e.Cancel = true; if (SuggestionProvider != null) { SuggestionProvider.ProvideSuggestions(e.Parameter) .ContinueOnSuccessInTheUIThread(results => { AssociatedObject.ItemsSource = results; AssociatedObject.PopulateComplete(); }); } }
/// <summary> /// Request auto completion data from Nokia Music API. /// </summary> /// <param name="sender">AutoCompleteBox object</param> /// <param name="e">Event arguments</param> private async void SearchPopulating(object sender, PopulatingEventArgs e) { e.Cancel = true; if (this._artistSearch) { this.HandleSearchSuggestionsResponse(await App.ApiClient.GetArtistSearchSuggestionsAsync(e.Parameter)); } else { this.HandleSearchSuggestionsResponse(await App.ApiClient.GetSearchSuggestionsAsync(e.Parameter)); } }
protected override void OnPopulating(PopulatingEventArgs e) { if (((App)Application.Current).Database == null) { return; } var kwrds = new List <string>(); foreach (Keyword keyword in ((App)Application.Current).Database.GetKeywords(Text)) { kwrds.Add(keyword.NormalForm); } ItemsSource = kwrds; }
private void OnPopulating(object sender, PopulatingEventArgs e) { var command = FilterCommand; if (command == null) { return; } var parameter = new FilterParameter(AssociatedObject.PopulateComplete, e.Parameter); command.Execute(parameter); e.Cancel = true; }
private void OnRoleAutoCompleteBoxPopulating(object sender, PopulatingEventArgs e) { var acb = sender as AutoCompleteBox; if (acb != null) { var context = new SystemRoleDomainContext(); context.SearchRole(e.Parameter, (obj) => { if (Utility.Utility.CheckInvokeOperation(obj)) { acb.ItemsSource = obj.Value; } }, null); } }
/// <summary> /// The populating handler. /// </summary> /// <param name="sender">The source object.</param> /// <param name="e">The event data.</param> private void OnPopulatingAsynchronous(object sender, PopulatingEventArgs e) { AutoCompleteBox source = (AutoCompleteBox)sender; // Cancel the populating value: this will allow us to call // PopulateComplete as necessary. e.Cancel = true; // Use the dispatcher to simulate an asynchronous callback when // data becomes available Dispatcher.BeginInvoke( new Action(delegate() { source.ItemsSource = new string[] { e.Parameter + "1", e.Parameter + "2", e.Parameter + "3", }; // Population is complete source.PopulateComplete(); })); }
/// <summary> /// Performs test actions for the OnPopulating method. /// </summary> /// <param name="e">Event arguments.</param> protected override void OnPopulating(PopulatingEventArgs e) { PopulatingActions.DoPreTest(e); base.OnPopulating(e); PopulatingActions.DoTest(e); }
private void OnSuggest(PopulatingEventArgs e) { if (!_hasInputChanged || (Suggestions != null && Suggestions.Any(s => s.Description == Input))) { e.Cancel = true; return; } GoogleMapsServices.GetSuggestions( ViewModelLocator.MainStatic.MapCenter, Input, predictions => { Suggestions = predictions; if (CommandSuggestionComplete != null && CommandSuggestionComplete.CanExecute(null)) { CommandSuggestionComplete.Execute(null); } }); }
/// <summary> /// Raises the /// <see cref="E:System.Windows.Controls.AutoCompleteBox.Populating" /> /// event. /// </summary> /// <param name="e"> /// A /// <see cref="T:System.Windows.Controls.PopulatingEventArgs" /> that /// contains the event data. /// </param> protected virtual void OnPopulating(PopulatingEventArgs e) { #if SILVERLIGHT PopulatingEventHandler handler = Populating; if (handler != null) { handler(this, e); } #else RaiseEvent(e); #endif }
/// <summary> /// Handles the timer tick when using a populate delay. /// </summary> /// <param name="sender">The source object.</param> /// <param name="e">The event arguments.</param> private void PopulateDropDown(object sender, EventArgs e) { if (_delayTimer != null) { _delayTimer.Stop(); } // Update the prefix/search text. SearchText = Text; // The Populated event enables advanced, custom filtering. The // client needs to directly update the ItemsSource collection or // call the Populate method on the control to continue the // display process if Cancel is set to true. #if SILVERLIGHT PopulatingEventArgs populating = new PopulatingEventArgs(SearchText); #else PopulatingEventArgs populating = new PopulatingEventArgs(SearchText, PopulatingEvent); #endif OnPopulating(populating); if (!populating.Cancel) { PopulateComplete(); } }