开发者

How to use WPF's asterisk size value in codebehind?

开发者 https://www.devze.com 2023-01-08 17:52 出处:网络
I create some control in codebehind and would like to set its size dynamically. I can assign numerical values as well as System.Windows.GridLength.Auto, but there is no equivalent to \"*\".

I create some control in codebehind and would like to set its size dynamically. I can assign numerical values as well as System.Windows.GridLength.Auto, but there is no equivalent to "*".

Is that because the "*" from XAML gets trans开发者_如何转开发lated into code when the WPF gets parsed?

To give this some detail: There is a grid with three rows. I want the top and bottom row to take all the space they can, while the middle row remains auto-sized.


var gridLength = new GridLength(1, GridUnitType.Star);

More info.

0

精彩评论

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