Swithing between pages

Good evening,
Im learning Silverlight at the moment, and Ive got issues with switching between pages.

In the startup of Silverlight there is the following code:-
    Private Sub Application_Startup(ByVal o As Object, ByVal e As StartupEventArgs) Handles Me.Startup
        Me.RootVisual = New MainPage()
    End Sub

Open in new window


Is it possible that in the MainPage, i can run something like:-
          Application.RootVisual = New SecondPage()
          MainPage.dispose

Open in new window

tonelm54Asked:
Who is Participating?
 
Imran Javed ZiaConnect With a Mentor Consultant Software Engineer - .NET ArchitectCommented:
Hi,

in simple application where you don't have Navigation Frame you can simply use

Me.Content = New MyPage()

for Frame approch you have to use some other way,
Please let me know you application and navigation structure.

Thanks
0
 
lenordisteCommented:
I would use NavigationService.Navigate to switch pages:
http://msdn.microsoft.com/en-us/library/ms591053(VS.95).aspx
see this ressource for a broad overview in navigation for silverlight:
http://msdn.microsoft.com/en-us/library/cc838245(VS.95).aspx

in short:
NavigationService.Navigate(new Uri("MyPage.xaml", UriKind.Relative))

Open in new window

0
 
tonelm54Author Commented:
ok, thank you. I will have a play over the bank holidays.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.