R – Having an issue with CoverterParameter Binding in silverlight

bindingivalueconverternetsilverlightxaml

I am having an issue with the xaml parser not liking my binding statement but i cannot see anything wrong with the statement.

Invalid attribute value {Binding VehicleSpeed, ConverterParameter={Binding InMiles}, Converter={StaticResource SpeedConverter}, Mode=TwoWay} for property DataMemberBinding

VehicleSpeed and InMiles are parameters on the class that I have in the DataContext property of the xaml top level grid of the xaml document.

This statement used to work without the ConverterParameter by it is now complaining after added the second binding to the "bool InMiles" that i am trying to pass through to the ValueConverter.

If anyone can see anything wrong with this line please let me know.

Best Answer

You cannot bind the converter parameter, because it is not a dependency property of the binding object.

Instead you can pass the whole data item to the converter and use its VehicleSpeed and InMiles properties in the Convert() method.

Related Topic