New to Telerik UI for WPF? Start a free 30-day trial
Override Esc Key Logic of RadRibbonBackstage
Updated on Sep 15, 2025
Environment
| Product Version | 2023.2.606 |
| Product | RadRibbonView for WPF |
Description
How to override Escape key logic of the RadRibbonBackstage element.
Solution
To achieve this requirement, create a custom class that derives from the RadRibbonBackstage class.
Create class that derives from RadRibbonBackstage
C#
public class CustomBackstage : RadRibbonBackstage
{
}Override the HandleKey method that comes from the RadRibbonBackstage class and execute your custom logic.
Override the HandleKey method
C#
public class CustomBackstage : RadRibbonBackstage
{
protected override void HandleKey(KeyEventArgs e)
{
if (e.Key == Key.Escape
&& MessageBox.Show("Do you want to close the backstage?", "Confirmation", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
base.HandleKey(e);
}
}
}