System.Windows.Controls.AutoCompleteBox.OnIsDropDownOpenPropertyChanged C# (CSharp) Méthode

OnIsDropDownOpenPropertyChanged() private static méthode

IsDropDownOpenProperty property changed handler.
private static OnIsDropDownOpenPropertyChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void
d DependencyObject AutoCompleteTextBox that changed its IsDropDownOpen.
e DependencyPropertyChangedEventArgs Event arguments.
Résultat void
        private static void OnIsDropDownOpenPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            AutoCompleteBox source = d as AutoCompleteBox;

            // Ignore the change if requested
            if(source != null && source._ignorePropertyChange)
            {
                source._ignorePropertyChange = false;
                return;
            }

            bool oldValue = (bool)e.OldValue;
            bool newValue = (bool)e.NewValue;
            if(source != null)
            {
                if(newValue)
                {

                    source.TextUpdated(source.Text, true);

                }
                else
                {
                    source.ClosingDropDown(oldValue);
                }

                source.UpdateVisualState(true);
            }
        }
        #endregion public bool IsDropDownOpen