简体   繁体   English

在设计时获得控件的大小

[英]Get control's size in design-time

I need to get control's size dynamically even in design-time. 我需要动态控制尺寸,即使在设计时也是如此。 If in runtime there is OnRender and other methods, but in design-time there is no such. 如果在运行时有OnRender和其他方法,但在设计时没有这样的方法。

I need it to create correct DependencyProperty that will place another controls inside of parent dependent on parent's size. 我需要它来创建正确的DependencyProperty,它将在父级中放置另一个控件,这取决于父级的大小。 Any ideas? 有任何想法吗?

Thanks a lot! 非常感谢!

This is the responsibility of a Panel . 这是Panel的责任。 A Panel has a collection of children and is responsible for measuring and arranging those children according to its layout rules. Panel有一系列儿童,负责根据儿童的布局规则来衡量和安排这些儿童。 If none of the built-in panels are suitable for your purposes, you can always write your own. 如果没有任何内置面板适合您的目的,您可以随时编写自己的面板。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM