Answered by:
Page unload of previous page happens after ready function of a current page
Question
-
When navigating away from a page, the unload function executes after the ready function. My problem is I have,
//unload function of the page navigating away from unload: function() { appBar.winControl.disabled = false; } //ready function of the page navigating to ready: function () { appBar.winControl.disabled = true; }In this case I want the appBar disabled on both the pages navigating away from and navigating to. All other pages have appBar enabled. When navigating as above if I disable the appBar in the ready function of the new page, it gets enabled again when the unload function of the previous page executes.
Is there any way to detect if the previous page is unloaded?
Sunday, December 22, 2013 3:01 AM
Answers
-
my app have a single appBar in default.html common to all pages.
Yes the unload code(of previous page, navigating away from) above executes, but after the ready function of the page navigating to. So the appBar gets disabled when the ready code executes(the required behaviour), but gets enabled again when the unload code(of previous page, navigating away from) executes.
- Marked as answer by Jeff SandersMicrosoft employee, Moderator Friday, December 27, 2013 2:54 PM
Tuesday, December 24, 2013 1:42 AM -
That would be the behavior I would expect. You will need to use different logic to accomplish what you want.
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions @WSDevSol
Getting Started With Windows Azure Mobile Services development? Click here
Getting Started With Windows Phone or Store app development? Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Thursday, December 26, 2013 2:14 PM
- Marked as answer by Jeff SandersMicrosoft employee, Moderator Friday, December 27, 2013 2:54 PM
Thursday, December 26, 2013 2:14 PMModerator -
Ok thanks, I ended up editing the navigator.js file to execute a function in the page control navigating to, after the current page unloads.
- Marked as answer by Jeff SandersMicrosoft employee, Moderator Friday, December 27, 2013 2:54 PM
Thursday, December 26, 2013 10:59 PM
All replies
-
Doesn't the unload code above execute?
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions @WSDevSol
Getting Started With Windows Azure Mobile Services development? Click here
Getting Started With Windows Phone or Store app development? Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)Monday, December 23, 2013 1:31 PMModerator -
my app have a single appBar in default.html common to all pages.
Yes the unload code(of previous page, navigating away from) above executes, but after the ready function of the page navigating to. So the appBar gets disabled when the ready code executes(the required behaviour), but gets enabled again when the unload code(of previous page, navigating away from) executes.
- Marked as answer by Jeff SandersMicrosoft employee, Moderator Friday, December 27, 2013 2:54 PM
Tuesday, December 24, 2013 1:42 AM -
That would be the behavior I would expect. You will need to use different logic to accomplish what you want.
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions @WSDevSol
Getting Started With Windows Azure Mobile Services development? Click here
Getting Started With Windows Phone or Store app development? Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support)- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Thursday, December 26, 2013 2:14 PM
- Marked as answer by Jeff SandersMicrosoft employee, Moderator Friday, December 27, 2013 2:54 PM
Thursday, December 26, 2013 2:14 PMModerator -
Ok thanks, I ended up editing the navigator.js file to execute a function in the page control navigating to, after the current page unloads.
- Marked as answer by Jeff SandersMicrosoft employee, Moderator Friday, December 27, 2013 2:54 PM
Thursday, December 26, 2013 10:59 PM