Reputation: 4481
It's easy in WPF to define styles that apply by default to each TextBox, for example.
But these styles and ControlTemplates can not influence the default settings of my bindings, e.g. I want
<TextBox Text="{Binding}" />
to behave like
<TextBox Text="{Binding UpdateSourceTrigger=PropertyChanged}" />
by default.
Also, if I bind the TextBox.Text to a nullable numeric property, I would like to have TargetNullValue='' in the binding, and maybe always say ValidateOnDataErrors=True...
Have you seen a nice way to manage such default behaviors?
Upvotes: 1
Views: 89
Reputation: 4895
I suggest you derive from the default binding and inplement everything you want in your custom class. THere is no other way probably.
Upvotes: 2