“RemoveBackEntry”在WP8中工作,但在WP8.1中不起作用
var backStackList = PageHelper.RootApplicationFrame.BackStack.ToList();
foreach (var page in backStackList)
{
if (!pageName.Contains("MainPage"))
{
if (page.Source.ToString().Contains(pageName))
{
PageHelper.RootApplicationFrame.RemoveBackEntry();
}
}
}
答案 0 :(得分:1)
试试这个..
var backStackList = PageHelper.RootApplicationFrame.BackStack.ToList();
foreach (var page in backStackList)
{
if (!pageName.Contains("MainPage"))
{
if (page.SourcePageType.ToString().Contains(pageName))
{
PageHelper.RootApplicationFrame.BackStack.RemoveAt(PageHelper.RootApplicationFrame.BackStack.Count - 1);
}
}
}