Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove a specific page from the backstack #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/Cimbalino.Toolkit (WPA81)/Services/NavigationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,24 @@ public virtual bool RemoveBackEntry()
return false;
}

/// <summary>
/// Removes an entry from the RootFrame's BackStack.
/// </summary>
/// <param name="type">the <see cref="System.Type"/> the last entry of the BackStack must be to be able to remove the BackEntry.</param>
public void RemoveBackEntry(Type type)
{
if (_frame.BackStack == null || _frame.BackStack.Count < 1)
{
return;
}

while (_frame.BackStack.Any(e => e.SourcePageType == type))
{
var entry = _frame.BackStack.First(e => e.SourcePageType == type);
_frame.BackStack.Remove(entry);
}
}

/// <summary>
/// Clears the backstack for the frame in its entirety.
/// </summary>
Expand Down