The Silverlight2 app has 4 images in a grid on the page. I need to set the height, width and margins for each image. These values cannot be constants, because then they will not be displayed correctly for the various possible screen resolutions. These properties should get their values from calculations using only the resolution of the screen. The composite look and feel of these images should be the same regardless of the resolution.
The images are all square, right-aligned and top-aligned, so I only need to set the margins from the top and right (left and bottom margins = 0), and use a single value for height and width.
I use the following to get the resolution:
string Width = Convert.ToString(HtmlPage.Window.Eval("screen.width"));
string Height = Convert.ToString(HtmlPage.Window.Eval("screen.height"));