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.");
}
}