private void OnIntervalElapsed(object sender, ElapsedEventArgs e) { this.IsKeyEvent = false; // pause the timer this._interval.Stop(); this.Dispatcher.BeginInvoke((Action) delegate { this.IsDropDownOpen = true; if (this.PatternChanged != null) { AutoComboBoxEventAgs args = new AutoComboBoxEventAgs(this.Text); this.PatternChanged(this, args); if (!args.Cancel) { this.ItemsSource = args.DataSource; if (this.TypeAhead) { this.Text = args.Pattern; this.EditableTextBox.CaretIndex = args.Pattern.Length; } } } }); }
private void OnIntervalElapsed(object sender, ElapsedEventArgs e) { this.IsKeyEvent = false; // pause the timer this._interval.Stop(); this.Dispatcher.BeginInvoke((Action)delegate { this.IsDropDownOpen = true; if (this.PatternChanged != null) { AutoComboBoxEventAgs args = new AutoComboBoxEventAgs(this.Text); this.PatternChanged(this, args); if (!args.Cancel) { this.ItemsSource = args.DataSource; if (this.TypeAhead) { this.Text = args.Pattern; this.EditableTextBox.CaretIndex = args.Pattern.Length; } } } }); }