WP7 Tombstoning and Querystring

时光毁灭记忆、已成空白 提交于 2019-12-24 20:23:56

问题


I am running very basic xml reader and I pass some data to the details page by using:

    private void HaberlerListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        if (e.AddedItems.Count > 0)
        {
            NavigationService.Navigate(new Uri("/News.xaml", UriKind.Relative));

            FrameworkElement root = Application.Current.RootVisual as FrameworkElement;
            root.DataContext = (HaberItem)e.AddedItems[0];

            ((ListBox)sender).SelectedIndex = -1;
        }
    }

For a week I am trying to read and understand how to deal with Tombstoning but I failed. I managed to use Tombstone Helper but i couldn't save images and webbrowser content.

In the earlier question: WP7 - Resume from the page I assigned . I heard that I can save the navigation url so when the user clicks back wp7 will navigate to the same url like before. (For the records:I don't use ViewModel)

I would like to get your view on how to save this url so My damned :) application can tombstone and I can rest a while :D.

Thanks in advance.


回答1:


The page URI, including querystring, is restored when an application returns from its tombstoned state. Rather that using Tombstone Helper I would recommend that you learn how tombstoning actually works, have a read of this article:

http://www.scottlogic.co.uk/blog/colin/2011/05/a-simple-windows-phone-7-mvvm-tombstoning-example/

It's not too complicated.



来源:https://stackoverflow.com/questions/6772588/wp7-tombstoning-and-querystring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!