Binding TextBinding = BindingOperations.GetBinding(this, TextBox.TextProperty); TextBinding.ValidationRules.Add(MyValidationRule);