不包含Windows Phone 8.1中的删除错误条目()的定义

时间:2015-03-06 04:11:27

标签: c# windows-phone-8.1

“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();
                    }
                 }
             }

1 个答案:

答案 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);
                }
         }
     }