How to get Window width/height
-
I'm trying to get Window width by calling:
- Window.width
However it returns "undefined". It's the same for other Window properties:
- Window.height
- Window.x
- Window.maximumWidth
I tried to use it instead of calling some root Item:
- itemId.width
because in some Screen.onHeightChanged callback it returns 0.
Why is it undefined ? Do I make something wrong ?
-
Hi @lajtu,
Since those are not attached properties they will need to be accessed byid
i.eWindow
'sid
. -
Aww, OK. I thought it works the same as Screen, e.g.
- Screen.width
-
@lajtu For
Screen
it works becausewidth
is an Attached Property for it.