Content Archived

This content is no longer current.

Navigating and Passing Data between XAML Pages - Day 3 - Part 3

Play Navigating and Passing Data between XAML Pages - Day 3 - Part 3

The Discussion

  • User profile image

    /appname;component/foldername/pagename doesn't work for me to navigate between pages.
    What does work is simply /pagename (or /foldername/pagename for that matter). Perhaps they have updated that since you produced the vid..? (wouldn't be surprised if they did that in response to developers having a hard time with that unintuitive "/appname;component/" way with no assistance from VS whatsoever)

  • User profile image

    @Sven: You actually don't have to do it that way.  There is a much easier way. For this example if you just had your NavigateUri="/View/Page1.xaml" you'd be fine.  This also would work if you did NavigateService.

    NavigationService.Navigate(new Uri("/Views/Page1.xaml", UriKind.Relative));

  • User profile image

    it is COLON not SEMI colon in the path. The video was just clear enough to see that although bob says semi colon it might be a colon and after an hour of messaging about thinking I had the terms in the path wrong, I tried /appname:folder/filename.xaml and it worked.


  • User profile image

    Hi there

    I just wanted to ask if "AppPhoneService.State["value"]" is the way to keep values like Sessions in or no. Is there anything else like Sessions here?

  • User profile image

    Like Sven the "/NavigatingBetweenP..." does not work (using VS2010 VB .NET) but simply "/folder/file" does work.

  • User profile image

    I tried mine with colon : and it didnt work, then with semi colon ; and it didnt work. then all I did was changed the p in page1.xaml to a capital and it worked, then when I went back to the URI it was in lower case and it still worked. very strange. But cool video anyway

  • User profile image
    Brilliant. Thanks for this. I have been following your tutorials since the first one. They have been the BEST tutorials for any programming language I have found :)
  • User profile image

    I have a question related to the final part of this tutorial where Bob overrode the navigate to/from methods. He did this in order to ensure that previous input was stored and displayed correctly after navigating back through the hyperlink button. He stated that he needed to do this as the hyperlink button caused a new instance of the mainpage to be created.

    I am presuming that overriding the methods does not prevent the creation of a new main page instance but simply populates the new instance with the correct data.

    Does this mean that the application will now have 2 instances of main page loaded in memory? If yes, How do you ensure that your navigation from a hyperlink returns to the already instantiated page?

    You could possibly create an application with many means of navigating to a given page. Having multiple instance of the same page loaded into memory seems rather wasteful.

  • User profile image

    @made_rdj Those were so interesting questions. I tried to guess some answers. I think that when you navigate away from a page, that instance of the page is always destroyed. It seems logical because the page is no longer shown, and when you navigate again into the page, another instance of the page is created, so, there is always only one instance of that page. When you navigate back to the page by using the back button, a new instance of the page is created, but is populated with data that Silverlight stored somewhere. I guess you're always getting a fresh instance of the page (populated with data or no depending on whether you are using the back button or a hyperlink) and there are no unreachable multiple instances of the page wasting the memory.

  • User profile image

    Wondering why he went his route with when this works fine:
    Dim str as String = String.Empty
    NavigationContext.QueryString.TryGetValue("language", str)

  • User profile image

    Quick question if I may. When using the "NavigationService" class there is a method called... GoBack(). Is there a reason it was not covered in this video? Say... maybe can present some unwanted issues? Or is it just one of those "Well here is another way to achieve the same result"?

    private void button1_Click(object sender, RoutedEventArgs e)

    Great videos guys!!!

  • User profile image

    I have a question related to this video.
    Should we use only hyperlink button to navigate between the pages?
    cant we use button control? suppose if i want to go to next page after i click on the button,how can i do that? can anyone plsss tell me...

  • User profile image

    u can use button in place of hyperlink.Code is like that:-

     NavigationService.Navigate(new Uri("/AppName;component/Page.xaml", UriKind.Relative));

  • User profile image

    The link for the source code is not working



Add Your 2 Cents