I have a data entry form with many controls. I want all controls to be bound to my data source, and all bindings to have NotifyOnSourceUpdated=True,UpdateSourceTrigger=PropertyChanged
, but I want to avoid writing this in the binding of every control.
Is there a way to set the common binding for all controls (most of them are TextBoxes)?
I tried things like:
<Style TargetType="Binding">
<Setter Property="NotifyOnSourceUpdated" Value="True" />
</Style>
or
<Style TargetType="TextBox">
<Setter Property="Binding.NotifyOnSourceUpdated" Value="True" />
</Style>
But they fail with exceptions.