Ok, so I have an array declared as so:
var names_Array = [];
Then I am creating a list and that list is composed of the elements in the above array. It is declared as so:
var names_List = new WinJS.Binding.List(names_Array);
Based on a condition in my first page. I am adding items to this list, as so:
if (condition) {
names_List.push({ name: "xxx", image: "image/xxx.png", ClientID: "xxxx" });
}
Then I am moving to another page and my goal is for when I come back to have any of the elements which were added still there. I am aware, as of now that when I go back, the list is empty because of the line:
var names_Array = [];
So my question is, is there any way to keep the items of the list, when I move away and come back. I realise I need an additional if condition in the first page to determine if this is the first time on the page or if the user has gone away and come back. Something like:
if (first){
if(condition){
sort out list;
}
}
else{
re-sort out list
}
Any ideas?