Microsoft.Phone.Controls.PhoneTextBox.OnLengthIndicatorThresholdChanged C# (CSharp) Method

OnLengthIndicatorThresholdChanged() private method

private OnLengthIndicatorThresholdChanged ( DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs args ) : void
sender System.Windows.DependencyObject
args System.Windows.DependencyPropertyChangedEventArgs
return void
        private static void OnLengthIndicatorThresholdChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            PhoneTextBox phoneTextBox = sender as PhoneTextBox;

            if (phoneTextBox._ignorePropertyChange)
            {
                phoneTextBox._ignorePropertyChange = false;
                return;
            }

            if (phoneTextBox.LengthIndicatorThreshold < 0)
            {
                phoneTextBox._ignorePropertyChange = true;
                phoneTextBox.SetValue(LengthIndicatorThresholdProperty, args.OldValue);

                throw new ArgumentOutOfRangeException("LengthIndicatorThreshold", "The length indicator visibility threshold must be greater than zero.");
            }

        }