Binding to Grid.columndefinition with MVVM
I would like to define the number of column of my silverlight 3 Grid with DataBinding.
How can I do this ?
With code behind, I would have done something similar to 开发者_JAVA技巧that :
foreach (MyObject o in MyObjectList)
{
grid.ColumnDefinitions.Add(
new ColumnDefinition() { Width = new GridLength(o.Length, GridUnitType.Star) });
}
But, I would like to try to follow the MVVM pattern and avoid this.
Thanks in advance for any help.
Best regards
精彩评论