Binding for MinWidth property does not work in Silverlight
- by Akash Kava
I have noticed something very unusual today, I need to bind "MinWidth" property of TextBlock to some value, however following example does not work. It only accepts MinWidth at a time of creation, but after that it is not affected at all if LeftWidth property is changed at runtime, however if I bind LeftWidth property to WidthProperty it works well.
Binding b = new Binding("LeftWidth");
// following never changes layout of control
tb.SetBinding(TextBlock.MinWidthProperty,b);
However, this one works correctly,
// following never changes layout of control
tb.SetBinding(TextBlock.WidthProperty,b);
Now I also did hook events and tried to do InvalidateMeasure and InvalidateArrange on TextBlock, but it has no effect. Seems like Changing MinWidth Property after layout pass does not work at all.
Can it be a bug in Silverlight? or Does anyone have any idea at all why MinWidth does not redo the layout?