From 397739b85cfa616315740a360279f301847fa59d Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 25 Dec 2024 06:59:33 +0300 Subject: [PATCH] Disable page refreshing (#1298) --- .../NavigationView/NavigationViewContentPresenter.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Wpf.Ui/Controls/NavigationView/NavigationViewContentPresenter.cs b/src/Wpf.Ui/Controls/NavigationView/NavigationViewContentPresenter.cs index 66817641e..23595cfaf 100644 --- a/src/Wpf.Ui/Controls/NavigationView/NavigationViewContentPresenter.cs +++ b/src/Wpf.Ui/Controls/NavigationView/NavigationViewContentPresenter.cs @@ -140,11 +140,23 @@ protected override void OnMouseDown(MouseButtonEventArgs e) if (e.ChangedButton is MouseButton.XButton1 or MouseButton.XButton2) { e.Handled = true; + return; } base.OnMouseDown(e); } + protected override void OnPreviewKeyDown(KeyEventArgs e) + { + if (e.Key == Key.F5) + { + e.Handled = true; + return; + } + + base.OnPreviewKeyDown(e); + } + protected virtual void OnNavigating(System.Windows.Navigation.NavigatingCancelEventArgs eventArgs) { NotifyContentAboutNavigatingTo(eventArgs.Content);