【问题标题】:WP7 Tombstoning and QuerystringWP7 墓碑和查询字符串
【发布时间】:2011-07-21 07:20:28
【问题描述】:

我正在运行非常基本的 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 assigned。我听说我可以保存导航 url,所以当用户点击返回时,wp7 将导航到与以前相同的 url。 (备案:我不使用ViewModel)

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

提前致谢。

【问题讨论】:

    标签: windows-phone-7 query-string tombstoning


    【解决方案1】:

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

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

    这并不复杂。

    【讨论】:

    • 谢谢科林。你的教程对我很有用。花了一些时间,但我终于做到了:P
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-06
    • 2017-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多