How to clear whole navigation history hosted by the WPF Frame control
问题 In a WPF application the Frame control is used to host/navigate pages. I'd like to clear the navigation history. There is NavigationService.RemoveBackEntry() method which can be used to clear the backward portion of the history. But what about the forward navigation history? How to clear this part? What is the best practice? Thank you in advance. 回答1: Here's the code I used to clear a Frame's navigation history: public void ClearHistory() { if (!this.Frame.CanGoBack && !this.Frame