/// <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); } }
/// <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. PopulatingEventArgs populating = new PopulatingEventArgs(SearchText); OnPopulating(populating); if (!populating.Cancel) { PopulateComplete(); } }