开发者

Binding to Grid.columndefinition with MVVM

开发者 https://www.devze.com 2023-02-11 15:24 出处:网络
I would like to define the number of column of my silverlight 3 Grid with DataBinding. How can I do this ?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消