Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 773219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:55:51+00:00 2026-05-14T18:55:51+00:00

Whilst building a Windows Phone 7 app. using the MVVM pattern we’ve struggled to

  • 0

Whilst building a Windows Phone 7 app. using the MVVM pattern we’ve struggled to get to grips with a pattern or technique to centralise navigation logic that will fit with MVVM.

To give an example, everytime the app. calls our web service we check that the logon token we’ve assigned the app. earlier hasn’t expired. We always return some status to the phone from the web service and one of those might be Enum.AuthenticationExpired.

If we receive that I’d imagine we’d alert the user and navigate back to the login screen. (this is one of many examples of status we might receive)

Now, wanting to keep things DRY, that sort of logic feels like it should be in one place. Therein lies my question.

How should I go about modelling navigation that relies on (essentially) switch or if statements to tell us where to navigate to next without repeating that in every view.

Are there recognised patterns or techniques that someone could recommend?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:55:51+00:00Added an answer on May 14, 2026 at 6:55 pm

    It sounds like you have a “state” (something you would switch on) followed by an action (where you would navigate to). There are a number of ways to handle it. One would be to create an INavigationService that exposes the NavigateTo(something) method, where something encapsulates the current state, and the method returns the next state. Perhaps that method would also perform the page swapping itself.

    Another way might be to create an IEnumerable that drives the pages, which would make sense in an application driving forward but gets a little fuzzy when you are trying to manage the back button.

    With the INavigate, you can push and pop pages (enqueue/dequeue) and then the login would get pushed to the top of the stack and do its thing, then pop the page to return to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While building a Search for my app i ran into a problem whilst using
Whilst a few questions mention using Lua in conjunction with some other language, I
Whilst building some unit tests for my Lucene queries I noticed some strange behavior
I am building a Windows Workflow into a .Net webapp. The problem I have
In a recent task at work, I've been building the PHP end (using SimpleXMLElement)
Whilst implementing my first MVVM application in WPF, I've been wondering about the pros
Whilst learning the assembler language (in linux on a x86 architecture using the GNU
We have some corporate intranet users using a WinForms app to work on a
I'm building a web app that'll read the contents of a Facebook page. It's
Whilst using Xcode 4.0 and trying to debug and see what value is held

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.