Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening Dev Tools crashes the app when a context menu is applied via a style #13887

Closed
BAndysc opened this issue Dec 9, 2023 · 2 comments · Fixed by #13802
Closed

Opening Dev Tools crashes the app when a context menu is applied via a style #13887

BAndysc opened this issue Dec 9, 2023 · 2 comments · Fixed by #13802
Labels

Comments

@BAndysc
Copy link
Contributor

BAndysc commented Dec 9, 2023

Describe the bug

When a context menu is applied via a style, I am experiencing two weird things:

  1. It looks like CommandParameter gets rebound to Avalonia.Diagnostics.ViewModels.SetterViewModel whatever it is, which is very bad as in my app I am using DelegateCommand, which casts the parameter to type T, which of course fails in this case making my app crash.

  2. For a test I provided my custom ICommand, which doesn't cast the parameter, but the app still crashes, this time due to Control already having a visual parent, see crashlog # 2 below.

This is a regression, it didn't happen in Avalonia 0.10.x

To Reproduce

Steps to reproduce the behavior:

  1. Create view and viewmodel as follows:

View:

<Button Content="Hello">
        <Button.Styles>
                <Style Selector="Button" x:DataType="vm:ViewModel">
                        <Setter Property="ContextMenu">
                                <ContextMenu>
                                        <MenuItem Header="Option" CommandParameter="{CompiledBinding}" Command="{CompiledBinding}" />
                                </ContextMenu>
                        </Setter>
                </Style>
        </Button.Styles>
</Button>

ViewModel:

public partial class ViewModel : ICommand
{
    public bool CanExecute(object? parameter)
    {
        if (parameter != null && parameter is not MainWindow)
            throw new Exception("Invalid type: " + parameter.GetType());
        return false;
    }
    public void Execute(object? parameter) { }
    public event EventHandler? CanExecuteChanged;
}
  1. Start the app
  2. Open the context menu
  3. Open DevTools
  4. Crash:
Unhandled exception. System.Exception: Invalid type: Avalonia.Diagnostics.ViewModels.SetterViewModel
   at AvaloniaControlThemestTest.MainWindow.CanExecute(Object parameter) in /Users/bartek/Programowanie/temp/AvaloniaControlThemestTest/AvaloniaControlThemestTest/MainWindow.axaml.cs:line 19
   at Avalonia.Controls.MenuItem.TryUpdateCanExecute() in /_/src/Avalonia.Controls/MenuItem.cs:line 599
   at Avalonia.Controls.MenuItem.CommandParameterChanged(AvaloniaPropertyChangedEventArgs e) in /_/src/Avalonia.Controls/MenuItem.cs:line 566
   at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value) in /_/src/Avalonia.Base/Reactive/LightweightObservableBase.cs:line 149
   at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty`1 property, Optional`1 oldValue, BindingValue`1 newValue, BindingPriority priority, Boolean isEffectiveValue) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 708
   at Avalonia.PropertyStore.EffectiveValue`1.SetAndRaiseCore(ValueStore owner, StyledProperty`1 property, T value, BindingPriority priority, Boolean isOverriddenCurrentValue, Boolean isCoercedDefaultValue) in /_/src/Avalonia.Base/PropertyStore/EffectiveValue`1.cs:line 243
   at Avalonia.PropertyStore.EffectiveValue`1.SetLocalValueAndRaise(ValueStore owner, StyledProperty`1 property, T value) in /_/src/Avalonia.Base/PropertyStore/EffectiveValue`1.cs:line 74
   at Avalonia.PropertyStore.ValueStore.SetLocalValue[T](StyledProperty`1 property, T value) in /_/src/Avalonia.Base/PropertyStore/ValueStore.cs:line 219
   at Avalonia.PropertyStore.LocalValueBindingObserverBase`1.<OnNext>g__Execute|15_0(LocalValueBindingObserverBase`1 instance, BindingValue`1 value) in /_/src/Avalonia.Base/PropertyStore/LocalValueBindingObserverBase.cs:line 100
   at Avalonia.PropertyStore.LocalValueBindingObserverBase`1.OnNext(BindingValue`1 value) in /_/src/Avalonia.Base/PropertyStore/LocalValueBindingObserverBase.cs:line 110
   at Avalonia.PropertyStore.LocalValueBindingObserver`1.OnNext(Object value) in /_/src/Avalonia.Base/PropertyStore/LocalValueBindingObserver.cs:line 22
   at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value) in /_/src/Avalonia.Base/Reactive/LightweightObservableBase.cs:line 149
   at Avalonia.Data.Core.BindingExpression.InnerListener.OnNext(Object value) in /_/src/Avalonia.Base/Data/Core/BindingExpression.cs:line 368
   at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value) in /_/src/Avalonia.Base/Reactive/LightweightObservableBase.cs:line 149
   at Avalonia.Data.Core.ExpressionObserver.ValueChanged(Object value) in /_/src/Avalonia.Base/Data/Core/ExpressionObserver.cs:line 313
   at Avalonia.Data.Core.ExpressionNode.ValueChanged(Object value, Boolean notify) in /_/src/Avalonia.Base/Data/Core/ExpressionNode.cs:line 113
   at Avalonia.Data.Core.ExpressionNode.ValueChanged(Object value) in /_/src/Avalonia.Base/Data/Core/ExpressionNode.cs:line 95
   at Avalonia.Data.Core.ExpressionNode.StartListeningCore(WeakReference`1 reference) in /_/src/Avalonia.Base/Data/Core/ExpressionNode.cs:line 78
   at Avalonia.Data.Core.ExpressionNode.StartListening() in /_/src/Avalonia.Base/Data/Core/ExpressionNode.cs:line 145
   at Avalonia.Data.Core.ExpressionNode.set_Target(WeakReference`1 value) in /_/src/Avalonia.Base/Data/Core/ExpressionNode.cs:line 43
   at Avalonia.Data.Core.ExpressionObserver.<StartRoot>b__33_0(Object x) in /_/src/Avalonia.Base/Data/Core/ExpressionObserver.cs:line 298
   at Avalonia.Reactive.Observable.<>c__DisplayClass2_1`2.<Select>b__1(TSource input) in /_/src/Avalonia.Base/Reactive/Observable.cs:line 43
   at Avalonia.Reactive.AnonymousObserver`1.OnNext(T value) in /_/src/Avalonia.Base/Reactive/AnonymousObserver.cs:line 65
   at Avalonia.Reactive.SingleSubscriberObservableBase`1.PublishNext(T value) in /_/src/Avalonia.Base/Reactive/SingleSubscriberObservableBase.cs:line 50
   at Avalonia.Data.BindingBase.UpdateSignal.PropertyChanged(Object sender, AvaloniaPropertyChangedEventArgs e) in /_/src/Markup/Avalonia.Markup/Data/BindingBase.cs:line 279
   at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty`1 property, Optional`1 oldValue, BindingValue`1 newValue, BindingPriority priority, Boolean isEffectiveValue) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 708
   at Avalonia.PropertyStore.EffectiveValue`1.RaiseInheritedValueChanged(AvaloniaObject owner, AvaloniaProperty property, EffectiveValue oldValue, EffectiveValue newValue) in /_/src/Avalonia.Base/PropertyStore/EffectiveValue`1.cs:line 109
   at Avalonia.PropertyStore.ValueStore.InheritedValueChanged(AvaloniaProperty property, EffectiveValue oldValue, EffectiveValue newValue) in /_/src/Avalonia.Base/PropertyStore/ValueStore.cs:line 795
   at Avalonia.PropertyStore.ValueStore.InheritedValueChanged(AvaloniaProperty property, EffectiveValue oldValue, EffectiveValue newValue) in /_/src/Avalonia.Base/PropertyStore/ValueStore.cs:line 795
   at Avalonia.PropertyStore.ValueStore.SetInheritanceParent(AvaloniaObject newParent) in /_/src/Avalonia.Base/PropertyStore/ValueStore.cs:line 395
   at Avalonia.AvaloniaObject.set_InheritanceParent(AvaloniaObject value) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 77
   at Avalonia.StyledElement.Avalonia.Controls.ISetInheritanceParent.SetParent(AvaloniaObject parent) in /_/src/Avalonia.Base/StyledElement.cs:line 518
   at Avalonia.Controls.Presenters.ContentPresenter.UpdateChild(Object content) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 476
   at Avalonia.Controls.Presenters.ContentPresenter.UpdateChild() in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 437
   at Avalonia.Controls.Presenters.ContentPresenter.ApplyTemplate() in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 400
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 529
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Controls.StackPanel.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/StackPanel.cs:line 262
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Controls.StackPanel.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/StackPanel.cs:line 262
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Border.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Border.cs:line 183
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1138
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 997
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 960
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 448
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Border.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Border.cs:line 183
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Border.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Border.cs:line 183
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Controls.StackPanel.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/StackPanel.cs:line 262
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Border.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Border.cs:line 183
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Controls.Presenters.ScrollContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs:line 382
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1138
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 997
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 960
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 489
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1138
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 997
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 960
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 489
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1138
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 997
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 960
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 489
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1138
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 997
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 960
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 489
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1138
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 997
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 960
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 489
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1138
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 997
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 960
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 489
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 63
   at Avalonia.Controls.Decorator.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Decorator.cs:line 54
   at Avalonia.Controls.Primitives.VisualLayerManager.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Primitives/VisualLayerManager.cs:line 139
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 541
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Controls.Window.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Window.cs:line 922
   at Avalonia.Controls.WindowBase.MeasureCore(Size availableSize) in /_/src/Avalonia.Controls/WindowBase.cs:line 274
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 373
   at Avalonia.Layout.LayoutManager.Measure(Layoutable control) in /_/src/Avalonia.Base/Layout/LayoutManager.cs:line 304
   at Avalonia.Layout.LayoutManager.ExecuteInitialLayoutPass() in /_/src/Avalonia.Base/Layout/LayoutManager.cs:line 191
   at Avalonia.Controls.Window.ShowCore(Window owner) in /_/src/Avalonia.Controls/Window.cs:line 706
   at Avalonia.Controls.Window.Show(Window owner) in /_/src/Avalonia.Controls/Window.cs:line 645
   at Avalonia.Diagnostics.DevTools.Open(IDevToolsTopLevelGroup topLevelGroup, DevToolsOptions options, Window owner, Application app) in /_/src/Avalonia.Diagnostics/Diagnostics/DevTools.cs:line 132
   at Avalonia.Diagnostics.DevTools.Open(TopLevel root, DevToolsOptions options) in /_/src/Avalonia.Diagnostics/Diagnostics/DevTools.cs:line 43
   at Avalonia.Diagnostics.DevTools.<>c__DisplayClass2_0.<Attach>g__PreviewKeyDown|0(Object sender, KeyEventArgs e) in /_/src/Avalonia.Diagnostics/Diagnostics/DevTools.cs:line 32
   at Avalonia.Interactivity.Interactive.<AddHandler>g__InvokeAdapter|4_0[TEventArgs](Delegate baseHandler, Object sender, RoutedEventArgs args) in /_/src/Avalonia.Base/Interactivity/Interactive.cs:line 64
   at Avalonia.Interactivity.Interactive.<>c__4`1.<AddHandler>b__4_1(Delegate baseHandler, Object sender, RoutedEventArgs args) in /_/src/Avalonia.Base/Interactivity/Interactive.cs:line 70
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e) in /_/src/Avalonia.Base/Interactivity/EventRoute.cs:line 118
   at Avalonia.Interactivity.EventRoute.RaiseEvent(Interactive source, RoutedEventArgs e) in /_/src/Avalonia.Base/Interactivity/EventRoute.cs:line 79
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e) in /_/src/Avalonia.Base/Interactivity/Interactive.cs:line 126
   at Avalonia.Input.KeyboardDevice.ProcessRawEvent(RawInputEventArgs e) in /_/src/Avalonia.Base/Input/KeyboardDevice.cs:line 233
   at Avalonia.Input.InputManager.ProcessInput(RawInputEventArgs e) in /_/src/Avalonia.Base/Input/InputManager.cs:line 37
   at Avalonia.Controls.TopLevel.HandleInput(RawInputEventArgs e) in /_/src/Avalonia.Controls/TopLevel.cs:line 749
   at Avalonia.Native.WindowBaseImpl.RawKeyEvent(AvnRawKeyEventType type, UInt64 timeStamp, AvnInputModifiers modifiers, UInt32 key) in /_/src/Avalonia.Native/WindowImplBase.cs:line 334
   at Avalonia.Native.WindowBaseImpl.WindowBaseEvents.Avalonia.Native.Interop.IAvnWindowBaseEvents.RawKeyEvent(AvnRawKeyEventType type, UInt64 timeStamp, AvnInputModifiers modifiers, UInt32 key) in /_/src/Avalonia.Native/WindowImplBase.cs:line 252
   at Avalonia.Native.Interop.Impl.__MicroComIAvnWindowBaseEventsVTable.RawKeyEvent(Void* this, AvnRawKeyEventType type, UInt64 timeStamp, AvnInputModifiers modifiers, UInt32 key) in /_/src/Avalonia.Native/Interop.Generated.cs:line 4313
--- End of stack trace from previous location ---
   at Avalonia.Native.DispatcherImpl.RunLoop(CancellationToken token) in /_/src/Avalonia.Native/DispatcherImpl.cs:line 113
   at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl) in /_/src/Avalonia.Base/Threading/DispatcherFrame.cs:line 117
   at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame) in /_/src/Avalonia.Base/Threading/Dispatcher.MainLoop.cs:line 53
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.MainLoop.cs:line 80
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 127
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 220
   at AvaloniaControlThemestTest.Program.Main(String[] args) in /Users/bartek/Programowanie/temp/AvaloniaControlThemestTest/AvaloniaControlThemestTest/Program.cs:line 12

To reproduce # 2

Don't bind any command, just add a menu

<Button Content="Hello">
        <Button.Styles>
                <Style Selector="Button" x:DataType="vm:ViewModel">
                        <Setter Property="ContextMenu">
                                <ContextMenu>
                                        <MenuItem Header="Option"  />
                                </ContextMenu>
                        </Setter>
                </Style>
        </Button.Styles>
</Button>
Unhandled exception. System.InvalidOperationException: The control already has a visual parent.
   at Avalonia.Visual.ValidateVisualChild(Visual c) in /_/src/Avalonia.Base/Visual.cs:line 659
   at Avalonia.Collections.AvaloniaList`1.Add(T item) in /_/src/Avalonia.Base/Collections/AvaloniaList.cs:line 205
   at Avalonia.Controls.Presenters.ContentPresenter.UpdateChild(Object content) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 484
   at Avalonia.Controls.Presenters.ContentPresenter.UpdateChild() in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 437
   at Avalonia.Controls.Presenters.ContentPresenter.ApplyTemplate() in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 400
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Controls.StackPanel.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/StackPanel.cs:line 262
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Controls.StackPanel.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/StackPanel.cs:line 262
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Border.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Border.cs:line 183
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1138
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 997
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 960
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 448
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Border.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Border.cs:line 183
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Border.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Border.cs:line 183
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Controls.StackPanel.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/StackPanel.cs:line 262
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Border.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Border.cs:line 183
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Controls.Presenters.ScrollContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs:line 382
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1138
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 997
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 960
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 489
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1138
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 997
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 960
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 489
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1138
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 997
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 960
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 489
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1138
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 997
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 960
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 489
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1138
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 997
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 960
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 489
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1138
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 997
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 960
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 489
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 47
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 583
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutHelper.MeasureChild(Layoutable control, Size availableSize, Thickness padding) in /_/src/Avalonia.Base/Layout/LayoutHelper.cs:line 63
   at Avalonia.Controls.Decorator.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Decorator.cs:line 54
   at Avalonia.Controls.Primitives.VisualLayerManager.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Primitives/VisualLayerManager.cs:line 139
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 585
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 608
   at Avalonia.Controls.Window.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Window.cs:line 922
   at Avalonia.Controls.WindowBase.MeasureCore(Size availableSize) in /_/src/Avalonia.Controls/WindowBase.cs:line 274
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Base/Layout/Layoutable.cs:line 395
   at Avalonia.Layout.LayoutManager.Measure(Layoutable control) in /_/src/Avalonia.Base/Layout/LayoutManager.cs:line 312
   at Avalonia.Layout.LayoutManager.ExecuteInitialLayoutPass() in /_/src/Avalonia.Base/Layout/LayoutManager.cs:line 191
   at Avalonia.Controls.Window.ShowCore(Window owner) in /_/src/Avalonia.Controls/Window.cs:line 706
   at Avalonia.Controls.Window.Show(Window owner) in /_/src/Avalonia.Controls/Window.cs:line 645
   at Avalonia.Diagnostics.DevTools.Open(IDevToolsTopLevelGroup topLevelGroup, DevToolsOptions options, Window owner, Application app) in /_/src/Avalonia.Diagnostics/Diagnostics/DevTools.cs:line 132
   at Avalonia.Diagnostics.DevTools.Open(TopLevel root, DevToolsOptions options) in /_/src/Avalonia.Diagnostics/Diagnostics/DevTools.cs:line 43
   at Avalonia.Diagnostics.DevTools.<>c__DisplayClass2_0.<Attach>g__PreviewKeyDown|0(Object sender, KeyEventArgs e) in /_/src/Avalonia.Diagnostics/Diagnostics/DevTools.cs:line 32
   at Avalonia.Interactivity.Interactive.<AddHandler>g__InvokeAdapter|4_0[TEventArgs](Delegate baseHandler, Object sender, RoutedEventArgs args) in /_/src/Avalonia.Base/Interactivity/Interactive.cs:line 64
   at Avalonia.Interactivity.Interactive.<>c__4`1.<AddHandler>b__4_1(Delegate baseHandler, Object sender, RoutedEventArgs args) in /_/src/Avalonia.Base/Interactivity/Interactive.cs:line 70
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e) in /_/src/Avalonia.Base/Interactivity/EventRoute.cs:line 118
   at Avalonia.Interactivity.EventRoute.RaiseEvent(Interactive source, RoutedEventArgs e) in /_/src/Avalonia.Base/Interactivity/EventRoute.cs:line 79
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e) in /_/src/Avalonia.Base/Interactivity/Interactive.cs:line 126
   at Avalonia.Input.KeyboardDevice.ProcessRawEvent(RawInputEventArgs e) in /_/src/Avalonia.Base/Input/KeyboardDevice.cs:line 233
   at Avalonia.Input.InputManager.ProcessInput(RawInputEventArgs e) in /_/src/Avalonia.Base/Input/InputManager.cs:line 37
   at Avalonia.Controls.TopLevel.HandleInput(RawInputEventArgs e) in /_/src/Avalonia.Controls/TopLevel.cs:line 749
   at Avalonia.Native.WindowBaseImpl.RawKeyEvent(AvnRawKeyEventType type, UInt64 timeStamp, AvnInputModifiers modifiers, UInt32 key) in /_/src/Avalonia.Native/WindowImplBase.cs:line 334
   at Avalonia.Native.WindowBaseImpl.WindowBaseEvents.Avalonia.Native.Interop.IAvnWindowBaseEvents.RawKeyEvent(AvnRawKeyEventType type, UInt64 timeStamp, AvnInputModifiers modifiers, UInt32 key) in /_/src/Avalonia.Native/WindowImplBase.cs:line 252
   at Avalonia.Native.Interop.Impl.__MicroComIAvnWindowBaseEventsVTable.RawKeyEvent(Void* this, AvnRawKeyEventType type, UInt64 timeStamp, AvnInputModifiers modifiers, UInt32 key) in /_/src/Avalonia.Native/Interop.Generated.cs:line 4313
--- End of stack trace from previous location ---
   at Avalonia.Native.DispatcherImpl.RunLoop(CancellationToken token) in /_/src/Avalonia.Native/DispatcherImpl.cs:line 113
   at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl) in /_/src/Avalonia.Base/Threading/DispatcherFrame.cs:line 117
   at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame) in /_/src/Avalonia.Base/Threading/Dispatcher.MainLoop.cs:line 53
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.MainLoop.cs:line 80
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 127
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 220
   at AvaloniaControlThemestTest.Program.Main(String[] args) in /AvaloniaControlThemestTest/AvaloniaControlThemestTest/Program.cs:line 12

Expected behavior

This is a regression! It didn't happen in Avalonia 0.10.x

Environment

  • OS: Mac
  • Avalonia-Version: 11.0.6
@BAndysc BAndysc added the bug label Dec 9, 2023
@BAndysc BAndysc changed the title Opening Dev Tools crashes the app when a context menu is applied via style Opening Dev Tools crashes the app when a context menu is applied via a style Dec 9, 2023
@maxkatz6
Copy link
Member

maxkatz6 commented Dec 9, 2023

Can you reproduce it with this branch - #13802? It might have fixed your problem, if it's SetterViewModel related.

@BAndysc
Copy link
Contributor Author

BAndysc commented Dec 9, 2023

Tested and both issues seem to be fixed! Thanks :)

edit:
(reopened the issue until the fix is merged)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants