Browse Source

Detach grid hack on logical tree detachment.

Doing it on visual tree detachment caused the menu to bug out when showing a submenu more than once.
pull/3602/head
Steven Kirk 6 years ago
parent
commit
df3fd0472e
  1. 10
      src/Avalonia.Controls/MenuItem.cs

10
src/Avalonia.Controls/MenuItem.cs

@ -325,6 +325,9 @@ namespace Avalonia.Controls
{
Command.CanExecuteChanged -= CanExecuteChanged;
}
_gridHack?.Dispose();
_gridHack = null;
}
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
@ -350,13 +353,6 @@ namespace Avalonia.Controls
}
}
protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
{
base.OnDetachedFromVisualTree(e);
_gridHack.Dispose();
_gridHack = null;
}
/// <summary>
/// Called when the <see cref="MenuItem"/> is clicked.
/// </summary>

Loading…
Cancel
Save