I am new to Silverlight and I just wanted to ask why my ActualHeight
was set to NaN? It has a width and height of 500, but when compiled, it gives an error that says that ActualHeight
is equal to NaN. Is there some other way to do this? Any help would be appreciated. Thanks.
Asked
Active
Viewed 566 times
2

Dave Clemmer
- 3,741
- 12
- 49
- 72

Nathan
- 1,520
- 1
- 12
- 21
-
In your question you wrote "height was set to NaN" - headline says ActualHeight is NaN - So what is exactly the problem? Normally you set the "Height" property in your productive code to some value - ActualHeight is a resized value depending on browser window size / parent container size – Grrbrr404 Nov 24 '11 at 06:53
-
So ActualHeight doesn't work when height is defined? – Nathan Nov 24 '11 at 06:55
-
Height of what? By the way, is this really a JavaScript question? – nnnnnn Nov 24 '11 at 06:59
-
I am no wpf / xaml expert - But if i have to guess: Maybe ActualHeight is not set as long as no resize is required. Try to to force resizeing and see what happens, i am no expert :) – Grrbrr404 Nov 24 '11 at 07:01
1 Answers
1
NaN stands for "Not a Number".
1).When you have set the width of the object explicitly ActualWidth
and RenderSize.Width
will be set to 0.0.
2). When you have set the width of the object to Auto Width will be set to NaN.

Dave Clemmer
- 3,741
- 12
- 49
- 72

Allan Chua
- 9,305
- 9
- 41
- 61
-
nice, thanks for the answer. It's quite bugging me not to know these things. – Nathan Nov 24 '11 at 07:19