WP7 - 如何从堆栈中删除旧页面? [英] WP7 - How to remove the old pages from Stack??
问题描述
嗨专家..在我的申请中有超过20页。
Hi experts.. In my application there are more than 20 pages.
我想在导航后销毁或删除页面。
Here i want to destroy or remove the page after navigation.
当用户点击后退按钮时,它应该转到主页面。
When user click the back button it should go to the Main page.
我关注MVVM,我的导航代码是: -
I am following MVVM and my navigation code is:-
groupButton = new ReactiveAsyncCommand();
var groupBtnResults = groupButton.RegisterAsyncObservable(_ =>
{
return HTTPServices.postAndGetResponse((new SearchOperation().Groups()));
});
groupBtnResults.Subscribe(
x =>
{
var rootFrame = (App.Current as App).RootFrame;
rootFrame.Navigate(new Uri("/com/views/MyGroupsPage.xaml", UriKind.Relative));
}
);
这里如何从页面堆栈中删除页面?我发现这种方法可以销毁页面
Here how to remove the page from Page stack?? I have found this method to destroy the page
NavigationService.RemoveBackEntry();
但我无法使用这在订阅方法中?
But i can not use this in Subscribe method?
请告诉我在哪里必须使用代码删除旧页面?
Please let me know where i have to use the code for remove the old pages??
提前致谢...
推荐答案
您是否考虑过删除后面的条目加载目标网页?
(例如:在页面'加载的事件处理程序中。)
Have you considered removing the back entries after loading the target page?
(for example: in the pages' Loaded event handler.)
这篇关于WP7 - 如何从堆栈中删除旧页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!