设置为自动时从C#获取宽度和高度? [英] Getting Width and Height from C# when set to Auto?

查看:74
本文介绍了设置为自动时从C#获取宽度和高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿!

我需要获取从C#设置为Auto的网格的当前宽度和高度。

I need to get the current width and height of a grid that is set to Auto from C#.

我一直得到NaN(不是回数)

如果我关闭"自动"我工作正常,但是当应用程序调整大小时,我的网格不会自动调整大小。

I keep getting NaN (Not a number back)
If I turn off "auto" I it works fine, but then my grid will not auto-size when the app is resized.

任何人都知道如何做到这一点?

Anyone have an idea how to do this?

 

谢谢!

 

 

推荐答案

您正在访问哪些属性?你试过ActualHeight和ActualWidth吗?
Which properties are you accessing? Have you tried ActualHeight and ActualWidth?


这篇关于设置为自动时从C#获取宽度和高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆