New to Telerik UI for WPF? Download free 30-day trial

Disable Esc Key Press in RadNavigationView

Environment

Product Version 2020.3.1020
Product RadNavigationView for WPF

Description

How to disable the closing of the RadNavigationView menu on Esc key press.

Solution

Subscribe to the PreviewKeyDown event of RadNavigationView and handle it in case the Esc key is pressed.

private void RadNavigationView_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e) 
{ 
    if (e.Key == System.Windows.Input.Key.Escape) 
    { 
        e.Handled = true; 
    } 
} 
In this article