Community blog feed
WPF and "Binding to a Computed Value"
- Blog
- Mike Taulty
- Posted
- 12 Oct 2008 at 10:22
Summary
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; <StackPanel> <TextBlock Text="{Binding ElementName=theSlider,Path=Value}"/> <Slider x:Name="theSlider
Post extract
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;
<StackPanel>
<TextBlock Text="{Binding ElementName=theSlider,Path=Value}"/>
<Slider x:Name="theSlider" Minimum="1" Maximum="10" MinWidth="192"/>
</StackPanel>
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.
Related blog entries
-
WPF DataGrid and Hiding Columns
by mtaulty
-
DataGrid - Master/Details
by mtaulty
-
WPF - Experimenting with Multi-Input Pixel Shaders
by mtaulty
-
WPF and Virtual Earth
by mtaulty
-
WPF and Virtual Eath, Part 2
by mtaulty