Asked by:
Reload Page in Application.PageControlNavigator

Question
-
I have been working in developing Metro App and using Windows8 Controller 'Application.PageControlNavigator'. But there is a condition where I have to reload the page used with the 'Application.PageControlNavigator'.
Briefly explaining, I am working on JavaScript App which is launched from Webpage. For first time, it is working as expected but if the app is launched again (where app is still running or suspended) from the webpage, it does not work. Normally, in website, with the new link the new page is loaded. Is it possible in Metro?
Is there any way of reloading the application or only that page?
Any help will be great. Thank you in advance.
Narendra
Wednesday, September 19, 2012 6:53 AM
All replies
-
Hi Narendra,
I am having difficulty understanding the problem and the expected behavior. Can you give me more specifics?
-Jeff
Jeff Sanders (MSFT)
Wednesday, September 26, 2012 1:04 PMModerator -
Hi Jeff,
Sorry for not clearly mentioning the issue but I will try to make it more clear now. I have added 'Application.PageControlNavigator' element as:
<body> <div id="contenthost" data-win-control="Application.PageControlNavigator" data-win-options="{home: '/viewer.html'}"></div> ..... </body>
In viewer.html, there are lots of other resources (JavaScript and CSS) which are loaded on loading viewer.html. More specifically, I want to reload the 'viewer.html' page again (similar to reloading in webpage) which will reload all the resources (resources are changed based on some other conditions).
In website, it is much easier as only need to reload the page. (Note: Please keep in mind that this is kind of porting from website application to Windows8 application and was looking for easier and faster way.)
Any information would be appreciated. Thank you.
Narendra
Thursday, September 27, 2012 12:07 AM -
Oh, I think I understand you want to use Navigate:
http://msdn.microsoft.com/en-us/library/windows/apps/br229837.aspx
http://msdn.microsoft.com/en-us/library/windows/apps/hh738344.aspx
Jeff Sanders (MSFT)
- Proposed as answer by Jeff SandersMicrosoft employee, Moderator Thursday, September 27, 2012 2:06 PM
Thursday, September 27, 2012 2:05 PMModerator -
Hello Jeff,
Thank you for sharing the information.
Well, I have used that but I was wondering whether there is any command where we can use to manually reload the page again. For example, please refer to following scenario:
1. Launch the app [all the files (including default.html & viewer.html) and its resources are loaded at first time]
2. Switch back to different app and again launch the app (now nothing is reloaded but 'activate' event is fired).
So in No. 2, I want to also reload viewer.html page at 'activate' event, I know it looks like stupid idea but this is what I am looking for.
Actually, after doing lots of research and tests I couldn't do it. So I have removed 'Navigate' feature and kept simple to default.html. Now, it is working as expected. (Sorry but before I was trying to port quickly without much changes.)
Anyway, thank you very much for your support.
Narendra
Thursday, September 27, 2012 11:17 PM