diff --git a/src/Avalonia.Controls/MenuItem.cs b/src/Avalonia.Controls/MenuItem.cs
index 1a4b4974b2..f250f8da43 100644
--- a/src/Avalonia.Controls/MenuItem.cs
+++ b/src/Avalonia.Controls/MenuItem.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Collections.Specialized;
using System.Linq;
using System.Windows.Input;
using Avalonia.Automation;
@@ -571,7 +570,7 @@ namespace Avalonia.Controls
}
}
}
-
+
///
/// Closes all submenus of the menu item.
///
@@ -609,12 +608,12 @@ namespace Avalonia.Controls
}
}
-
+
private static void OnAccessKeyPressed(MenuItem sender, AccessKeyPressedEventArgs e)
{
- if (e is not { Handled: false, Target: null })
+ if (e is not { Handled: false, Target: null })
return;
-
+
e.Target = sender;
e.Handled = true;
}
@@ -789,15 +788,23 @@ namespace Avalonia.Controls
{
var (oldValue, newValue) = e.GetOldAndNewValue