开发者

Binding ColumnDefinitions in Silverlight

开发者 https://www.devze.com 2022-12-17 23:21 出处:网络
I have two separate 开发者_开发技巧Silverlight usercontrols containing grids and i want these to share a set of columndefinitions. The columndefinitions must be created dynamically. How can i do this?

I have two separate 开发者_开发技巧Silverlight usercontrols containing grids and i want these to share a set of columndefinitions. The columndefinitions must be created dynamically. How can i do this?


You can just add them in code if that is sufficient:

private void CreateColumnDefinitions(Grid grid)
        {
            grid.ColumnDefinitions.Add(
                new ColumnDefinition() { Width = new GridLength(10, GridUnitType.Star) });

            grid.ColumnDefinitions.Add(
                new ColumnDefinition() { Width = new GridLength(5, GridUnitType.Star) });

            grid.ColumnDefinitions.Add(
                new ColumnDefinition() { Width = new GridLength(5, GridUnitType.Star) });
        }
0

精彩评论

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

关注公众号