locked
How do I set the size of a silverlight pag based on a desired client browser size? RRS feed

  • Question

  • Hi all,

    I have created a silver light page and i want to display this page according to browser size, how can i do it? 

     

    Thanks in advance

    Monday, May 31, 2010 1:34 PM

All replies

  • To get the browser size you can use:

    HtmlPage.Window.Eval("screen.availWidth");

    HtmlPage.Window.Eval("screen.availHeight");

     

    If you want the app to size to the browser space automatically you can use relative units like auto with grids, *, etc to fill in all the space.

    you can also access (Application.Current.RootVisual as FrameworkElement).ActualWidth

     

    reference:

    http://forums.silverlight.net/forums/t/74301.aspx

    Tuesday, June 1, 2010 1:40 PM