Click here to Skip to main content
15,511,353 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a window(MainWindow.xaml) and 2 pages(page1.xaml,page2.xaml).In Page1, i have a button.

Now, i can use this :
    <pre lang="vb">
      Private Sub MainWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
      Frame.navigate(new page2)
      End sub

What i want is, i want to navigate to page2 by clicking the button on page1..

Something like this :
'This code is in Page1

 Private sub Btn1_Click handles
 MainWIndows.Frame.Navigate(new page2)
 End sub

This code doesn't work...One solution i found was to create a frame in page1 first and then navigate to page2 within the frame of page1 whereas i want to use the frame of MainWindow...Any help ?

What I have tried:

Is mentioned in the post .............
Updated 13-Jan-18 18:39pm

1 solution

This will cover what you need: Navigation Overview | Microsoft Docs[^] - Look at section on NavigationService
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900