Can I find out which page a user came from on Back Button press on WP7?

前端 未结 5 1040
南旧
南旧 2021-01-05 21:14

I haven\'t had much luck finding the answer through google searches, but is it possible to tell which page a user came from?

Or, send a query string on back button

5条回答
  •  日久生厌
    2021-01-05 22:07

    You can use the NavigationService to accomplish the desired result. Specifically, you can do something like this:

    var uri = NavigationService.CurrentSource;
    if(uri != badUri) { /*proceed...*/ } 
    

    Here is the reference page:

    http://msdn.microsoft.com/en-us/library/system.windows.navigation.navigationservice.currentsource.aspx

提交回复
热议问题