Back and Forward button click can be handled using the ‘CommandBindings’ property of the ‘NavigationWindows’ class.
The following code snippet is used to handle the ’Back’ button click in a NavigationWindow.
[C#]
//after InitializeComponent()
navwindow1.CommandBindings.Add(new CommandBinding(NavigationCommands.BrowseForward, OnBrowseForward));
void OnBrowseBack(object sender, ExecutedRoutedEventArgs args)
{
MessageBox.Show('Back Button is Clicked');
}
Share with