Well, I decided that I will describe all the methods that you can use the implicit methods that Silverlight allows you to specify the size.
If you define something using the Stretch parameter for the VerticalAlignment parameter in the control:
<TextBox Grid.Column="0" Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
The UIElement will stretch to cover all the space available to it in its parent control. Another option, for example, is to do something like determining the grid column width or row height as follows:
<ColumnDefinition Width="*"/>
It will take up all the space available on the screen.
You can grow columns and grid lines in the form of a relation:
<RowDefinition Height="3*"/> <RowDefinition Height="2*"/>
This will increase the height of the first row by 3px for every 2px than the second.
Then you may have options like Auto
<ColumnDefinition Width="Auto"/>
This will increase the UIElement according to size requirements. If a child of an element requires a larger size, the element takes up more space on the screen.
And finally:
<TextBox Grid.Column="1" Grid.Row="0" Height="100" MinWidth="200" MaxWidth="400" x:Name="text"/>
These are fixed values โโand ensures that at any resolution the element will not occupy more than 400 pixels in width, but not less than 200 pixels. It also indicates that the height of the element should always be 100 pixels. This is useful for elements such as buttons, etc., which you do not want to increase or decrease when changing the resolution.
Finally, you probably want to wrap the ScrollViewer around everything, just to make sure the items on the screen can be scrolled. This can happen when your view requires more space than is available on the screen, or has items set to Auto .