A small change to the Magellan page lifecycle?

16 views
Skip to first unread message

Scott Bussinger

unread,
Feb 16, 2011, 8:22:12 PM2/16/11
to magellan-friends
Paul,

I'd like to propose a small change to the page lifecycle in Magellan's
Page View engine. In simple terms, the current
PageViewEngineResult.Render() method prepares the new page, navigates
to it, then clears the navigation journal if appropriate.

I'd like to propose that it be changed to preparing a new page,
clearing the navigation journal (if appropriate), then navigating to
the new page. My reason for this is that if we're jumping to a new
page and clearing the journal, then I'd like to be able to clean up
the old page before moving to the new page.

In my particular case, the new page is somewhat dependent upon the
results of cleaning up the old page. If you do them in the other order
some information is not current. The change would only affect the case
where you're clearing the journal and I can't think of any reason why
you'd prefer to clear the journal after navigation rather than before.

The change is simply a matter of moving 4 lines of code up a bit. I
can send you a patch if you like. Your thoughts?

Paul Stovell

unread,
Feb 20, 2011, 6:59:18 AM2/20/11
to magellan...@googlegroups.com
Hi Scott,

I just tried implementing this, but it doesn't behave as you expected. 

Suppose this is your workflow:
  • Home
  • Wizard page 1
  • Wizard page 2
  • Wizard page 3
  • Return to Home, ClearNavigationJournal()
If you move the call to reset history before rendering the Home page, the journal will still contain the "WizardPage3" page. That's because while the WizardPage3 is visible, the journal (which we are clearing) only contains Home/1/2, not 3 yet. 

(Let me know if it behaves differently for you)

Would the Deactivated event on your view model be a better way to control this?

Paul

Scott Bussinger

unread,
Feb 25, 2011, 4:01:28 AM2/25/11
to magellan-friends
Hmmmm. I'm using a custom Navigation Service and that may be why it's
acting differently. I'll put together a test app and play with it.
I've been using a customized version of Magellan with the changes I
mentioned but was hoping to get back to the stock releases again.

As for deactivating, it's been a few months since I worked on that
section and I don't recall exactly why it didn't work for me now. I
think the deactivating event wasn't called in all situations. Again,
I'll play with it a bit and come back.

On Feb 20, 3:59 am, Paul Stovell <p...@paulstovell.com> wrote:
> Hi Scott,
>
> I just tried implementing this, but it doesn't behave as you expected.
>
> Suppose this is your workflow:
>
>    - Home
>    - Wizard page 1
>    - Wizard page 2
>    - Wizard page 3
>    - Return to Home, ClearNavigationJournal()
> > can send you a patch if you like. Your thoughts?- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages