WPF and "Binding to a Computed Value"

I was talking to Eric at FOWA about how you might be able to databind in WPF whilst applying some kind of multiplication factor.

For instance you might want to do something like this;

   <TextBlock Text="{Binding ElementName=theSlider,Path=Value}"/>
   <Slider x:Name="theSlider" Minimum="1" Maximum="10" MinWidth="192"/>

except you might want to have the TextBlock display some multiple of what’s in the slider.

I was about to set off trying to show how this might be done with a converter making use of the ConverterParameter when I found ( like most things ) that it was done before – specifically by Doug Stockwell up here;


that post is about 2 years old so Doug’s clearly a good 24 months ahead of me 🙂 and I’ve not tried his code so it might have changed on the latest version of the framework but the idea is definitely there.