I use pages and NavigationWindow:
navigationWindow = new NavigationWindow();
navigationWindow.Height = 200;
navigationWindow.Width = 100;
navigationWindow.WindowState = WindowState.Maximized;
page = new IntroPage();
navigationWindow.Navigate(page);
navigationWindow.Show();
I navigate by using GoBack and GoForward methods, but I don't want to use them by shortcuts (function buttons in mouse etc.) How can I disable these shortcuts?
In your navigation window XAML you can add this:
In code you could do the same like this:
There are other keys that can be prevented, such as BrowserHome and BrowserRefresh as well.
That prevents hotkeys, not mouse navigation if the navigation UI is being displayed. If you want to control navigation only programmatically you should hide the navigation UI with
ShowsNavigationUI="False"
in XAML (as a parameter of the NavigationWindow tag) or withmainWindow.ShowsNavigationUI = false;
in code.Also, you can prevent MouseBindings the same way I have done above for KeyBindings, adding new MouseBinding objects with the MouseAction property set.