0

I'm having trouble developping an app for Windows phone. Visually, the app is just a panorama displayed via the MainPage, and does nothing else. All the code must be running in background without the user seeing it. The app is open via a custom URL scheme which is something like "myscheme://..."

So here I have two questions :

1) How to perform the code in background with just the mainpage displayed on the screen

2) How can I tell the app when it's launched "go to that page" or "go to this page" depending on the URL received ? I have a "AssociationUriMapper" class that is accessed when the app is open via the customURL, and I have the code line

return new Uri("/Authentication.cs", UriKind.Relative);

For example when the app is called by an authentication URL, but it doesnt work and goes to the "navigation failed" function in the App.xaml.cs

Thank you

DevBob
  • 835
  • 2
  • 9
  • 29

1 Answers1

3

Once you navigate to the main page, you can override the method :

OnNavigatedTo(NavigationEventArgs e)

Once you land into this function, you can have several classes in you project which serve as the back end logic for you. You can instantiate these classes from this function and carry out all the operations by calling appropriate method from those classes.

Moreover, in this function, you can also check for the Uri which caused the navigation to this page. And you can even seperate out parameters and decide what to do depending upon the parameters which are added in the uri.

In this method, you can check for all the necessary conditions that you wish to check and perform conditional navigation further.

I hope I am taking you in the right direction. Thanks and Cheers.

Gaurav Deochakke
  • 2,265
  • 2
  • 21
  • 26