运行时读取宽度值
当我读取 GridColumn 的宽度值时,我得到 xaml 中设置的默认值(640 像素)。但该列比运行时宽得多,因为它根据浏览器的宽度进行拉伸。在运行时,我想缩放一些控件以匹配它,但是当我读取列的值时,它仍然给我默认值 640。直到我实际使用 gridsplitter 调整列的大小,正确的值才会通过。有人知道如何在运行时获得列的真实宽度,而不必先调整它的大小吗?
Double a = this.Column1.Width.Value; // Gives me the default value of 640 while the column is much wider than that.
When I read the width value of my GridColumn I get the default value set in xaml (640 pixels). But the column is much wider than that in runtime because it stretches according to the width of the browser. In runtime I want to scale some of my controls to match that but when I read the value of my column it still gives me the default value 640. Until I actually resize the column with a gridsplitter the correct value get through. Anyone know how I can get the REAL width of the column during runtime without me having to resize it first?
Double a = this.Column1.Width.Value; // Gives me the default value of 640 while the column is much wider than that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
Try