2

I know I can set up start page in WMAppManifest.xml file.

Is there a way to set start page based on some condition?

I have an application that have 'remember me' funcionality so when app starts I would like it to go directly to some page. If user is not remembered then show log in screen.

Now I show a page and in it's logic I check this and if necessary I navigate to other page.

Is there a better way to do this?

Thanks, Bartek

bodziec
  • 564
  • 6
  • 20

3 Answers3

3

From this page, in your App.xaml.cs:

private void Application_Launching(object sender, LaunchingEventArgs e)
{
    Uri nUri = new Uri("/Page1.xaml", UriKind.Relative);
    ((App)Application.Current).RootFrame.Navigate(nUri);
}

Then open your WMAppManifest.xml file and clear the NavigationPage from the DefaultTask line.

<DefaultTask  Name ="_default" NavigationPage=""/>
Chris Benard
  • 2,979
  • 1
  • 24
  • 33
1

Have you seen this "WP7 - Dynamically change the startup page depending on setting":-

WP7 - Dynamically change the startup page depending on setting

Community
  • 1
  • 1
Paul Diston
  • 3,269
  • 1
  • 14
  • 19
0

I dont know of any better ways of conditionally redirecting to different pages other than having a loading page which checks and does the redirect for you.

gbanfill
  • 2,196
  • 13
  • 21