|
|
|
@ -97,6 +97,7 @@ namespace Avalonia.Controls |
|
|
|
private ICommand _command; |
|
|
|
private bool _commandCanExecute = true; |
|
|
|
private Popup _popup; |
|
|
|
private IDisposable _gridHack; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes static members of the <see cref="MenuItem"/> class.
|
|
|
|
@ -322,6 +323,9 @@ namespace Avalonia.Controls |
|
|
|
{ |
|
|
|
Command.CanExecuteChanged -= CanExecuteChanged; |
|
|
|
} |
|
|
|
|
|
|
|
_gridHack?.Dispose(); |
|
|
|
_gridHack = null; |
|
|
|
} |
|
|
|
|
|
|
|
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) |
|
|
|
@ -341,7 +345,9 @@ namespace Avalonia.Controls |
|
|
|
// the WPF codebase:
|
|
|
|
//
|
|
|
|
// https://github.com/dotnet/wpf/blob/89537909bdf36bc918e88b37751add46a8980bb0/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/MenuItem.cs#L2126-L2141
|
|
|
|
SetValue(DefinitionBase.PrivateSharedSizeScopeProperty, parent.GetValue(DefinitionBase.PrivateSharedSizeScopeProperty)); |
|
|
|
_gridHack = Bind( |
|
|
|
DefinitionBase.PrivateSharedSizeScopeProperty, |
|
|
|
parent.GetBindingObservable(DefinitionBase.PrivateSharedSizeScopeProperty)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|