I am building a MVVM Windows Phone 8 application.
I read this post to try to resolve tombstonning problems : http://www.scottlogic.com/blog/2011/10/03/a-windows-phone-7-1-mango-mvvm-tombstoning-example.html
This example implements Tombstonning on a MVVM application. The application generates a twitter feed in a listbox.
I changed the some lines of codes of this example as it deals with the old twitter api, but when I run the application, close it or activate Win or Search Buttons, and then re launch it again , the page state is not the same.
Here is what I changed in the view Model to simulate a new Twitter Feed :
j = new List<FeedItemViewModel>();
j.Add(new FeedItemViewModel
{
Author = "Auth",
Title = "Sample1",
Id = 1
});
j.Add(new FeedItemViewModel
{
Author = "Auth",
Title = "Sample2",
Id = 2
});
j.Add(new FeedItemViewModel
{
Author = "Auth",
Title = "Sample3",
Id = 3
});
j.Add(new FeedItemViewModel
{
Author = "Auth",
Title = "Sample4",
Id = 4
});
j.Add(new FeedItemViewModel
{
Author = "Auth",
Title = "Sample5",
Id = 5
});
foreach (FeedItemViewModel t in j)
{
this._feedItems.Add(t);
}
public void Update()
{
this._feedItems.Add(new FeedItemViewModel
{
Author = "_Auth",
Title = "_Sample",
Id = 99
});
}
But when I close my application and re launch it , the state is not the same, for example the scroller position is not the same as when I left the application although there is a method in this sample to remember the scrolling position of the list.
Do you know why tombstonning is not working properly?