locked
Navigation to another page on button click

    Question

  • hi Team,

    i wanted to know ,can i add Silverlight Navigation Application template in my existing project where in one folder contain the another project all pages(mean other module related pages).

    but when i right click on that folder then it is not given the option to adding Silverlight Navigation Application.

    so plz help me to resolve this problem

    thanks in advance

    Tuesday, December 20, 2011 11:30 PM

Answers

  • Hi mohan,

    Creating a new navigation application in visual studio is a good start to learn how to navigate.

    Basically, you need to add a Frame to your MainPage and set NavigateUri of HyperlinkButton or use NavigationService.Navigate() method to implement navigation.

    MainPage.xaml

        <Grid x:Name="LayoutRoot" Background="White">
            <sdk:Frame Source="/Pages/Page1.xaml" />
        </Grid>

    Pages/Page1.xaml

    <HyperlinkButton NavigateUri="/Pages/Page2.xaml" />

    or Pages/Page1.xaml.cs

     this.NavigationService.Navigate(new Uri("/Pages/Page2.xaml", UriKind.Relative));

     

    Best Regards,

    Thursday, December 22, 2011 9:30 PM

All replies

  • Wednesday, December 21, 2011 10:41 AM
  • Hi mohan,

    Creating a new navigation application in visual studio is a good start to learn how to navigate.

    Basically, you need to add a Frame to your MainPage and set NavigateUri of HyperlinkButton or use NavigationService.Navigate() method to implement navigation.

    MainPage.xaml

        <Grid x:Name="LayoutRoot" Background="White">
            <sdk:Frame Source="/Pages/Page1.xaml" />
        </Grid>

    Pages/Page1.xaml

    <HyperlinkButton NavigateUri="/Pages/Page2.xaml" />

    or Pages/Page1.xaml.cs

     this.NavigationService.Navigate(new Uri("/Pages/Page2.xaml", UriKind.Relative));

     

    Best Regards,

    Thursday, December 22, 2011 9:30 PM