hajpoj
hajpoj

Reputation: 13379

On application launch show 2 different pages based on a condition?

Does anyone know how to show two different "first" pages on application launch based on some condition.

an example of this would be show a log in page when a user has not entered their password yet, but show the main page once the user has entered their password once before.

I see that you can set the default navigation page in WMAppManifest.xml (below), and I was looking into possibly creating my own PhoneApplicationFrame, but I am unsure how I should go about it.

<Tasks>
     <DefaultTask  Name ="_default" NavigationPage="MainPage.xaml"/>
</Tasks>

Thanks for the help

Upvotes: 3

Views: 1510

Answers (3)

Mick N
Mick N

Reputation: 14882

Peter Torr covers page redirections quite well here. Two methods are offered with relative merits covered.

Redirecting an initial navigation - Peter Torr's Blog

I'd also recommend familiarising with his accompanying post on places here.

Introducing the concept of “Places” - Peter Torr's Blog

This address back stack handling (certification consideration) and addresses scenarios such as login pages.

Upvotes: 3

JP Alioto
JP Alioto

Reputation: 45117

You could have your main page do nothing but check the condition and then forward the caller to the correct "start page" or you could build your main page in accordance with the condition. The former seems like the easiest solution.

Upvotes: 0

MatthieuGD
MatthieuGD

Reputation: 4592

You can use a ChildWindow to show a modal window with the login form ?

http://wildermuth.com/2010/08/17/Using_ChildWindow_in_Windows_Phone_7_Projects

I used one for a first time run of my application to set preferences.

Upvotes: 1

Related Questions