How to clear all navigation history posted using WPF Frame control

In a WPF application, the Frame control is used to place / navigate pages. I would like to clear the navigation history. There is a NavigationService.RemoveBackEntry () method that you can use to clear the back of the story. But what about the history of advanced navigation? How to clean this part? What is the best practice? Thank you in advance.

+4
source share
2 answers

Here is the code I used to clear the frame navigation history:

public void ClearHistory() { if (!this.Frame.CanGoBack && !this.Frame.CanGoForward) { return; } var entry = this.Frame.RemoveBackEntry(); while (entry != null) { entry = this.Frame.RemoveBackEntry(); } this.Frame.Navigate(new PageFunction<string>() { RemoveFromJournal = true }); } 
+8
source

I have not tried, But you can try to go to the same page and then remove the link ...

0
source

Source: https://habr.com/ru/post/1387320/


All Articles