silverlight 怎么获取屏幕分辨率?
------解决方案--------------------------------------------------------
刚才在二群里有人发了同样这个问题,不会就是你吧?
------解决方案--------------------------------------------------------
double screenWidth = (double)HtmlPage.Window.Eval("screen.Width");
double screenHeight = (double)HtmlPage.Window.Eval("screen.Height");
网上看到的 感觉应该是这个、没用过这个。

------解决方案--------------------------------------------------------
/// <summary>
/// 浏览器屏幕信息类
/// </summary>
public class Browser
{
/// <summary>
/// During static instantiation, only the Netscape flag is checked
/// </summary>
static Browser()
{
_isNavigator = HtmlPage.BrowserInformation.Name.Contains("Netscape");
}
/// <summary>
/// Flag indicating Navigator/Firefox/Safari or Internet Explorer
/// </summary>
private static bool _isNavigator;
/// <summary>
/// Provides quick access to the window.screen ScriptObject
/// </summary>
private static ScriptObject Screen
{
get
{
ScriptObject screen = (ScriptObject)HtmlPage.Window.GetProperty("screen");
if (screen == null)
{
throw new InvalidOperationException();
}
return screen;
}
}
/// <summary>
/// Gets the window object's client width
/// </summary>