0

我正在运行非常基本的 xml 阅读器,并使用以下方法将一些数据传递到详细信息页面:

    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;
        }
    }

一个星期以来,我试图阅读并理解如何处理墓碑,但我失败了。我设法使用了 Tombstone Helper,但我无法保存图像和 webbrowser 内容。

在前面的问题中:WP7 - Resume from the page I assignment。我听说我可以保存导航 url,所以当用户点击返回时,wp7 将导航到与以前相同的 url。(备案:我不使用ViewModel)

我想了解您对如何保存此 url 的看法,以便我该死的 :) 应用程序可以墓碑,我可以休息一会儿 :D。

提前致谢。

4

1 回答 1

3

当应用程序从其墓碑状态返回时,将恢复页面 URI,包括查询字符串。而不是使用 Tombstone Helper,我建议您了解 tombstoneing 的实际工作原理,阅读这篇文章:

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

这不是太复杂。

于 2011-07-21T07:23:53.687 回答