Sunday, October 23, 2011

Frames & Pages in Silverlight

The Frame is a content control. It contains a single child element and it inherits from ContentControl. The single child it displays can be of the type Page. We can easily use this capability for developing an application that includes pages displayed one at a time within a frame. The following code sample shows how simple it is to do it. This is the MainPage.xaml file. It displays a Frame element together with few buttons the user can use in order to navigate to another page.
<UserControl x:Class="SilverlightApplication23.MainPage"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="500"

    <Grid x:Name="MainContainer" Background="White">
        <Grid.ColumnDefinitions>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition MaxHeight="100"></RowDefinition>
        </Grid.RowDefinitions>
        <sdk:Frame Height="179" Grid.Row="0" HorizontalAlignment="Left"
                   Margin="43,30,0,0" Name="MainFrame" VerticalAlignment="Top" Width="315" />

Read more: Life Michael
QR: frames-amp-pages-in-silverlight.aspx

Posted via email from Jasper-Net