Ejemplo n.º 1
0
        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;
                        }
                    }
                }
            });
        }
Ejemplo n.º 2
0
        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;
                        }
                    }
                }
            });
        }