|
|
|
@ -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 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Closes all submenus of the menu item.
|
|
|
|
/// </summary>
|
|
|
|
@ -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<object?>(); |
|
|
|
|
|
|
|
if (oldValue is ILogical oldLogical) |
|
|
|
if (oldValue is { }) |
|
|
|
{ |
|
|
|
LogicalChildren.Remove(oldLogical); |
|
|
|
if (oldValue is ILogical oldLogical) |
|
|
|
{ |
|
|
|
LogicalChildren.Remove(oldLogical); |
|
|
|
} |
|
|
|
|
|
|
|
PseudoClasses.Remove(":icon"); |
|
|
|
} |
|
|
|
|
|
|
|
if (newValue is ILogical newLogical) |
|
|
|
if (newValue is { }) |
|
|
|
{ |
|
|
|
LogicalChildren.Add(newLogical); |
|
|
|
if (newValue is ILogical newLogical) |
|
|
|
{ |
|
|
|
LogicalChildren.Add(newLogical); |
|
|
|
} |
|
|
|
|
|
|
|
PseudoClasses.Add(":icon"); |
|
|
|
} |
|
|
|
} |
|
|
|
|