* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
1.6 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | ||||
|---|---|---|---|---|---|---|---|---|
| How to: Navigate Back Through Navigation History | 03/30/2017 |
|
|
9343234b-d864-441d-b8a7-d895cba80a87 |
How to: Navigate Back Through Navigation History
This example illustrates how to navigate to entries in back navigation history.
Example
Code that is running from content that is hosted in a xref:System.Windows.Navigation.NavigationWindow, xref:System.Windows.Controls.Frame using xref:System.Windows.Navigation.NavigationService, or Internet Explorer can navigate back through navigation history, one entry at a time.
Navigating back one entry requires first checking that there are entries in back navigation history, by inspecting the CanGoBack property, before navigating back one entry, by calling the GoBack method. This is illustrated in the following example:
[!code-csharpHOWTONavigationSnippets#NavigateBackCODE] [!code-vbHOWTONavigationSnippets#NavigateBackCODE]
CanGoBack and GoBack are implemented by xref:System.Windows.Navigation.NavigationWindow, xref:System.Windows.Controls.Frame, and xref:System.Windows.Navigation.NavigationService.
Note
If you call GoBack, and there are no entries in back navigation history, an xref:System.InvalidOperationException is raised.