I want to figure out a way in my silverlight application to set the PageSize on my DataPager based开发者_开发知识库 on the maximized size of the window so that the scrollbars do not show when maximized. Any ideas?
Here is how I wound up doing it:
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;
.
.
.
Here is a post about checking in JavaScript if the Window is maximized. If you're running in browser, you should be able to call something like this from Silverlight.
http://www.codingforums.com/archive/index.php/t-127058.html
This page succinctly explains how to do it.
Hope this helps.
精彩评论