How to efficiently communicate between default page and PageControl elements?
-
Saturday, August 18, 2012 3:00 AMI have the default.html page and a PageControl element. I want to receive data from an external source, process it by the default page, and then send the processed data to the PageControl element to display it. I did not find any suitable way to pass information from default to PageControl. Could you please suggest the options?
All Replies
-
Monday, August 20, 2012 12:13 PMModerator
Hi
First create a Namespace in your javascript file to store this data,
WinJS.Namespace.define("ViewModel",{ UserData:WinJS.Binding.as({
UserData1:null,
UserData2:[];
})
});
When this data be processed, save it in a global WinJS.Namespace like this:
ViewModel.UserData.UserData1="abc";
Or you can use session state:
http://msdn.microsoft.com/en-us/library/windows/apps/hh440965.aspx
- Proposed As Answer by Jeff SandersMicrosoft Employee, Moderator Monday, August 20, 2012 7:21 PM
- Marked As Answer by Dino HeModerator Friday, August 31, 2012 6:39 AM
-
Monday, August 20, 2012 6:27 PMThanks! User-defined functions of WinJS.UI.Pages.define also look promising, so when data arrives I can route it to the scope I need.


