I'm trying to create a style that will attach a Converter to it so that when I use this style it will automatically use the converter. The problem I'm having is that if I don't set a path in the style, the compiler does not like it. I don't want to set the "Path" property of the binding in the style because I want to choose the path at design time. Not all control will automatically use the same Path name.
Here is my example :
<Style x:Key="SomeCustomTextBox" BasedOn="{StaticResource {x:Type TextBox}}" TargetType="{x:Type TextBox}">
<Setter Property="Text">
<Setter.Value>
<Binding>
<Binding.Path>SomePath</Binding.Path>
<Binding.Converter>
<Converters:SomeIValueConverter/>
</Binding.Converter>
</Binding>
</Setter.Value>
</Setter>
</Style>
Also, if I use the style in the like in the next line (here bellow) of my xaml code, it automatically overides the whole binding not just the binding path.
<TextBox Height="28" Name="someNameThatOveridesDefaultPath" Style="{StaticResource SomeCustomTextBox}" MaxLength="5" />
Is it possible somehow to do something like this?
Thanks! Patrick Miron