I have a web-app that I would like to be useful on DT and phone. In order to get the proper layout parts I tried to use
Screen.Screenat(0).AvaliableWidth
as I found somewhere in an example.
This wont’t work and reports error that type doesn’t exist.
Is there another way to find out the size of the screen that the app is running one?
Dick
Hi Dick,
Web app doesnt know anything about physical screen.
Web app layout is based on browser and webpage.
You need to check the browser page size in webpage.shown event and listen to resized event.
Thats not entirely accurate. There is a JavaScript property available on all modern browsers which will give you this information.
window.screen
Its a structure containing multiple items including screen dimensions, browser dimensions and browser offset from the top/left corner of the screen. Youll need a WebSDK control to retrieve it though.
Youre right, but getting these properties require javascript (even within WebSDK), AFAIK.
Getting the physical screen size is not going to help in this case, as the layout has to fit the browser.