locked
Dimension a page RRS feed

  • Question

  • Hi all!

    I'm a beginner in Expression Blend.And I want to learn how to create silverlight aplication.But i don't know to size a page to fit with the browser.I want that page to have exactly that dimension.To not be smaller that the browser page.Can you help me please?

     

    Thanks!!!

    Sunday, February 20, 2011 12:59 PM

Answers

  • Select the ScrollViewer and set the HorizontalScrollBarVisibility property value either to "Auto" or "Visible".
    • Marked as answer by AlinaFlorina Wednesday, February 23, 2011 12:57 PM
    Tuesday, February 22, 2011 2:29 PM
    • Marked as answer by AlinaFlorina Thursday, February 24, 2011 3:24 PM
    Wednesday, February 23, 2011 3:15 PM

All replies

  • Hello,

    To fit the available space, the layout root element shouldn't have Width, Height, VerticalAlignment and HorizontalAlignment properties defined.

    Here you can find a nice article about layout.

    I hope it helps you.


    Sergio Garrido. http://playsilverlight.wordpress.com
    • Proposed as answer by Leo Bartkus Monday, February 21, 2011 5:16 PM
    Sunday, February 20, 2011 3:25 PM
  • Thanks Sergio!

    Can you be more specific?I don't really understand from that site what i should do...:((

    Thanks again!

    Tuesday, February 22, 2011 10:08 AM
  • The silverlight plugin is hosted by the browser. The entire size of a silverlight app is defined through the dimension of the UserControl. The UserControl element is the top most element in the Objects and Timeline panel.

    To fit the total browser space with the UserControl you do the following:

    1) Select UserControl in the Objects and timeline panel.

    2) Go to the properties panel and search for Width and Height of UserControl. Set both values to "auto". You do this by clicking a little button in Blend which you will find right to the textbox for the width and height property, respectively.

    3) Set HorizontalAllignment and VerticalAllignment properties of UserControl both to "stretch".

    4) If you do so and your LayoutRoot element doens't have a fixed size, don't be confused that Blend resizes your app at design time to a quite small area. This happens only at designtime. You can set a design time size for your UserControl by selecting the direct selection tool (the little black arrow) and dragging and dropping the little trianlge sign which you will find at the bottom right corner of the UserControl.

    The design time size is ignored at runtime. So when you run your app (press F5) your silverlight app will fill the entire browser window.

    Hope this helps.

    Tuesday, February 22, 2011 10:30 AM
  • Thank.

    It really hep me.

    Tuesday, February 22, 2011 10:38 AM
  • If my reply solves your problem it would be nice if you could mark it as answer.

    Di you need further help?

    Tuesday, February 22, 2011 11:49 AM
  • Yes....

    The problem is when i restore down the browser window  i can't see the right half of the page?Usually all the web page have scroll.How i can add a window with scroll?

    Or it is another was to resolve the problem?

    Thanks

    Tuesday, February 22, 2011 12:06 PM
  • Add a ScrollViewer as the first child element of LayoutRoot, set HorizontalAlignment and VerticalAlignment to stretch and place the entire rest of your Ui inside the ScrollViewer (with a grid e.g. as top child inside the ScrollViewer).
    Tuesday, February 22, 2011 12:54 PM
  • ok.

    Thanks

    How i can add a orizontal scroll?

    Tuesday, February 22, 2011 1:16 PM
  • Select the ScrollViewer and set the HorizontalScrollBarVisibility property value either to "Auto" or "Visible".
    • Marked as answer by AlinaFlorina Wednesday, February 23, 2011 12:57 PM
    Tuesday, February 22, 2011 2:29 PM
  • i don't find that property....:((
    Wednesday, February 23, 2011 12:57 PM
    • Marked as answer by AlinaFlorina Thursday, February 24, 2011 3:24 PM
    Wednesday, February 23, 2011 3:15 PM