I have a StackPanel with a list of custom user controlls that I would like to resize. I would like the user to be able to drag a slider and scale the control size up and down.
Is there a way to bind the control width to a slider value? Something similar to:
<MyControl Width='{Binding Path=SizeSlider.SelectedValue}'/>
Is this possible? Or should I just iterate through the controls and manually set the size whenever the slider value changes?
You should be able to do this just fine by using
By only setting
Pathyou assume that something namedSizeSliderwould exist in the current DataContext.I’ve done this in code once and it worked:
So apparently
might be another way to do it.