Silverlight屏幕分辨率

时间:2010-06-15 14:56:18

标签: silverlight screen resolution

我想在我的silverlight应用程序中找到一种方法,根据窗口的最大化大小在我的DataPager上设置PageSize,以便滚动条在最大化时不显示。有什么想法吗?

3 个答案:

答案 0 :(得分:2)

以下是我如何做到这一点:

using System.Windows.Browser;

void View_Loaded(object sender, RoutedEventArgs e)
{
    Int32 intRowHeight = 30;
    Int32 intTopOfFirstRow = 240;
    pgrData.PageSize = ((Int32.Parse(HtmlPage.Window.Eval("screen.height").ToString())) - intTopOfFirstRow) / intRowHeight;
.
.
.

答案 1 :(得分:1)

这是一篇关于在窗口最大化时检入JavaScript的帖子。如果你在浏览器中运行,你应该可以从Silverlight调用这样的东西。

http://www.codingforums.com/archive/index.php/t-127058.html

答案 2 :(得分:0)

page简洁地解释了如何做到这一点。

希望这有帮助。