Hello,
I have a quetion concerning BINDING the width of a specifice field to a slider-value in XAML.
My grid's first field is retemplated by showing a viewbox with a specific shape in it.
On my XAML I have a slider for controlling the width of the viewbox via binding. This works perfectly and my shape in it is growing/shrinking as I move the slider.
But when my shape grows, the datagrid rows grows also --> so perfect. (shrinks also)
But my the field/column width does NOT change (grow).
I also tried to BIND the width of the field via the fieldsettings, but changes in the slider are not reflected (width of column does not change)
I tried several comibantions of the cell-label-min/max/width. But none seems to reflect to a binding at runtine.
<
igDP:FieldLayout.Fields>
</igDP:Field.Settings>
</igDP:Field>
<igDP:Field Name="line1" />
</igDP:FieldLayout.Fields>
and my slider
<Slider Margin="12,12,12,0" Name="slider1" Height="22" VerticalAlignment="Top" Maximum="1000" Minimum="300" SmallChange="20" LargeChange="100" Value
="450" />
I hope my question is somewhat clear. I just want a way to resize one field through a binding with a slider value at runtime. Is this possible in the grid?
This sounds like the same issue that Andrew Smith explains in this forum thread.
Thx for the link to the post. I have read them and tried some possibilities out.
*) the staticresource and the app-resources option did work, but designing the xaml-usercontrol was not possible anymore because the staticresource is not found at design-time (same happens in the demo of Josh)
So I tried the other methods also "the spy" and "the bridge" method, but they seem to work with a dataContext property which is not settable for fieldsettings etc...
But the last option "do it in code via BindingOperations" has done the trick. I did it for the cellwidth, labelwidth en width and it WORKS !
It is indeed a pitty that something that "simple" is not just possible in xaml and my VMMV-model. I now have to write a bunch of code (and clean-up code) to do the bindings in code-behind. But that's the way it is for now.
Thanks again for pointing me out to a working solution.