Binding to Grid.columndefinition with MVVM

546 Views Asked by At

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 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

0

There are 0 best solutions below