Resource

Remove All Navigation Back in Windows Phone

Arvind Vishwakarma Resources Sep 10, 2013

Before using below function, you need to include Microsoft.Phone.Controls nampespace in your project.

using Microsoft.Phone.Controls;

public static void RemoveAllNavigationBack()
{
    if (!((PhoneApplicationFrame)Application.Current.RootVisual).BackStack.Any()) return;
    var length = ((PhoneApplicationFrame)Application.Current.RootVisual).BackStack.Count();
    var i = 0;
    while (i < length)
    {
        ((PhoneApplicationFrame)Application.Current.RootVisual).RemoveBackEntry();
        i++;
    }
}

Or, you can remove Navigation Backstack by your choice.

public static void RemoveNavigationBack(int count)
{
    for (var i = 0; i < count; i++)
    {
        ((PhoneApplicationFrame)Application.Current.RootVisual).RemoveBackEntry();
    }
}

I hope you find this post helpful, Thanks for reading.

COMMENT USING
PREMIUM SPONSORS
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.
Tags
SPONSORED BY
  • MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.