Skip to content

Instantly share code, notes, and snippets.

@andyb
Created April 26, 2010 11:26
Show Gist options
  • Select an option

  • Save andyb/379223 to your computer and use it in GitHub Desktop.

Select an option

Save andyb/379223 to your computer and use it in GitHub Desktop.
public class TextBoxAttached : TextBox
{
#region ValidateOnTextChange (Attached DependencyProperty)
public static readonly DependencyProperty ValidateOnTextChangeProperty =
DependencyProperty.RegisterAttached("ValidateOnTextChange", typeof(bool), typeof(TextBoxAttached), new PropertyMetadata(new PropertyChangedCallback(OnValidateOnTextChangeChanged)));
public static void SetValidateOnTextChange(DependencyObject o, bool value)
{
o.SetValue(ValidateOnTextChangeProperty, value);
}
public static bool GetValidateOnTextChange(DependencyObject o)
{
return (bool)o.GetValue(ValidateOnTextChangeProperty);
}
private static void OnValidateOnTextChangeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
}
#endregion
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment