Skip to main content

Microsoft Silverlight

Answered Question Relation between silverlight usercontrol, page and FrameRSS Feed

(0)

Ajit Kumar Jha
Ajit Kum...

Member

Member

31 points

15 Posts

Relation between silverlight usercontrol, page and Frame

Hello all,

I have one question in my mind, because I am new in silverlight so don't get angry if question looks stupid.

Silverlight has three basic container mechanism 

1. Usercontrol,

2. Page

3. Frame

 Actually what is relation between them as an architecture point of view?

Is usercontrol same as in asp.net?

Is Page is same as in asp.net?

Can we have any Usercontrol in my page?

How the Frame is using page in Frame Navigation framework?

 

Thanks in Advance

Pravinkumar R. D.
Pravinku...

Contributor

Contributor

4300 points

708 Posts

Answered Question

Re: Relation between silverlight usercontrol, page and Frame

Hi,

Just check this link. Read it carefully. I guess many of your questions will be solved. Don't forget to click the links in artical -

http://msdn.microsoft.com/en-us/library/cc189034(VS.95).aspx#object_trees

Let  me know if this helps you.

Thanks,

Pravin

"Please mark as answered, if this answers your question"

Pravinkumar R. D.
Pravinku...

Contributor

Contributor

4300 points

708 Posts

Answered Question

Re: Relation between silverlight usercontrol, page and Frame

Hi,

Check this as well-

Is Page is same as in asp.net?

http://silverlight.net/forums/t/32569.aspx

Can we have any Usercontrol in my page?

-> The question  is not clear.

How the Frame is using page in Frame Navigation framework?

-> Check these links -

http://www.silverlightshow.net/items/The-Silverlight-3-Navigation-Framework.aspx

http://www.c-sharpcorner.com/UploadFile/dpatra/SilverlightNavigationFramework05282009032422AM/SilverlightNavigationFramework.aspx

Thanks,

Pravin

"Please mark as answered, if this answers your question"

Ajit Kumar Jha
Ajit Kum...

Member

Member

31 points

15 Posts

Answered Question

Re: Relation between silverlight usercontrol, page and Frame

 Thanks for reply,

I am going through the links sent by you.

Can we have any Usercontrol in my page?

Actually this question says that Can a silverlight Page (object of the page class) contains a usercontrol.

I got the answer also after searching on the net

the answer is

Usercontrol is just like another control which you can place in any other container control( this can be a grid, canvas, stackPanel or another usercontrol and any Page(Navigation Page). You can do it using two ways . 1. using xaml 2. using code view.

1. using xaml.

just include xmlns:test="clr-namespace:TestUserControl"  where

Test is any string you can keep as prefix of your control. and

TestUserControl is the name space in which the silverlight usercontrol resides.

then

<navigation:Page x:Class="SilverlightApplication1.Page1"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           xmlns:test="clr-namespace:TestUserControl "
           Title="Page1 Page">
    <Grid x:Name="LayoutRoot" ShowGridLines="True">
        <Grid.RowDefinitions>
            <RowDefinition Height="20"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="20"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <TextBlock Text="Hello Welcome to the SilverLight" Grid.Row="0" Grid.Column="0"></TextBlock>
        <TextBlock Text="This is footer." Grid.Row="2" Grid.Column="0"></TextBlock>
        <test:TestUserControl Grid.Row="1" Grid.Column="0" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0"></test:TestUserControl>
    </Grid>
</navigation:Page>

 

2. using code view you can create the instance of usercontrol and add it in the children list of the containercontrol such as grid.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities