WP7 逻辑删除和查询字符串
我正在运行非常基本的 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,但无法保存图像和网络浏览器内容。
在之前的问题中: WP7 - 从我分配的页面恢复 。我听说我可以保存导航 url,这样当用户单击返回时,wp7 将像以前一样导航到相同的 url。 (记录一下:我不使用 ViewModel)
我想听听您对如何保存此 url 的看法,这样我该死的:)应用程序可以墓碑,我可以休息一会儿:D。
提前致谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当应用程序从逻辑删除状态返回时,页面 URI(包括查询字符串)将被恢复。我建议您了解逻辑删除的实际工作原理,而不是使用 Tombstone Helper,请阅读这篇文章:
http://www.scottlogic.co.uk/blog/colin/2011/05/a-simple-windows-phone-7-mvvm-tombstoneing-example/
不太复杂。
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.