Star sizing is used to distribute available space by weighted proportions.

In Extensible Application Markup Language (XAML), star values are expressed as * or 2*. In the first case, the row or column would receive one times the available space; in the second case, the row or column would receive two times the available space, and so on.

The example then adds and positions an Image, RunIcon.png, to represent the image that is found in the dialog box. The image is placed in the first column and row of the Grid (the upper-left corner).

Next, the example adds a TextBlock element to the first column, which spans the remaining columns of the first row. It adds another TextBlock element to the second row in the first column, to represent the Open text box. A TextBlock follows, which represents the data entry area.

Finally, the example adds three Button elements to the final row, which represent the OK, Cancel, and Browse events.

<Pagexmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"WindowTitle="Grid Run Dialog Sample"WindowWidth="425"WindowHeight="225"><GridBackground="#DCDCDC"Width="425"Height="165"HorizontalAlignment="Left"VerticalAlignment="Top"ShowGridLines="True"><Grid.ColumnDefinitions><ColumnDefinitionWidth="Auto"/><ColumnDefinitionWidth="*"/><ColumnDefinitionWidth="*"/><ColumnDefinitionWidth="*"/><ColumnDefinitionWidth="*"/></Grid.ColumnDefinitions><Grid.RowDefinitions><RowDefinitionHeight="Auto"/><RowDefinitionHeight="Auto"/><RowDefinitionHeight="*"/><RowDefinitionHeight="Auto"/></Grid.RowDefinitions><ImageGrid.Column="0"Grid.Row="0"Source="RunIcon.png"/><TextBlockGrid.Column="1"Grid.ColumnSpan="4"Grid.Row="0"TextWrapping="Wrap">
Type the name of a program, folder, document, or
Internet resource, and Windows will open it for you.
</TextBlock><TextBlockGrid.Column="0"Grid.Row="1">Open:</TextBlock><TextBoxGrid.Row="1"Grid.Column="1"Grid.ColumnSpan="5"/><ButtonMargin="10, 0, 10, 15"Grid.Row="3"Grid.Column="2">OK</Button><ButtonMargin="10, 0, 10, 15"Grid.Row="3"Grid.Column="3">Cancel</Button><ButtonMargin="10, 0, 10, 15"Grid.Row="3"Grid.Column="4">Browse ...</Button></Grid></Page>