1

I am new to silverlight. I have to add multiple controls in a Navigation Frame. When i do like this ,i am getting error.

<Navigation:Frame Name="ContentFrame" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,55,12,12" BorderThickness="1" BorderBrush="Black" Grid.Column="1" Grid.ColumnSpan="3" Grid.RowSpan="5">
            <TextBlock Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="9,129,0,0" Name="textBlock2" Text="UserName:" VerticalAlignment="Top" />
            <TextBlock Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="12,22,0,0" Name="textBlock3" Text="Password:" VerticalAlignment="Top" Grid.Row="1" />
        </Navigation:Frame>

The Error is The property 'Content' cannot be set more than once. Where i am wrong. How to achieve this?

1 Answer 1

2

Frame is a ContentControl which means that it can only have a single child. You need to add a child control that is able to hold multiple children. Try a Grid for example:

<Navigation:Frame >
   <Grid>
        <TextBlock Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="9,129,0,0" Name="textBlock2" Text="UserName:" VerticalAlignment="Top" />
        <TextBlock Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="12,22,0,0" Name="textBlock3" Text="Password:" VerticalAlignment="Top" Grid.Row="1" />
   </Grid>
</Navigation:Frame>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.