I have about 100 TextBoxes in a Form. I need to validate them if they are decimal for instance. This works, but it is too verbose, I don't want to have 800 in place of 100 rows in XAML.
<TextBox.Text>
<Binding Path="MyPath" UpdateSourceTrigger="PropertyChanged" Stringformat="{}{0:N}" NotifyOnValidationError="True">
<Binding.ValidationRules>
<myRulesNamespace:MyValidationRule ValidationType="decimal" />
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
Is there any way how to rewrite it to the short form like this? :
Text="{Binding MyPath, UpdateSourceTrigger='PropertyChanged', StringFormat='{}{0:N}', NotifyOnValidationError=True, ValidationRules NOW WHAT?}"