Open TETYYS opened 2 years ago
Describe the bug Exception is thrown upon rendering a new window with TreeDataGrid without clear explanation of what went wrong
TreeDataGrid
To Reproduce Steps to reproduce the behavior:
treedatagrid-bug.zip
Expected behavior No exception or exception explaining incorrect usage
Stacktrace
Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Models.TreeDataGrid.ShowExpanderObservable`1.Subscribed() C# Avalonia.Base.dll!Avalonia.Reactive.SingleSubscriberObservableBase`1.Subscribe(System.IObserver observer = {unknown}) C# Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Models.TreeDataGrid.ExpanderCell`1..ctor(Avalonia.Controls.Models.TreeDataGrid.ICell inner = {unknown}, Avalonia.Controls.Models.TreeDataGrid.IExpanderRow row = {unknown}, System.IObservable<bool> showExpander = {unknown}, Avalonia.Experimental.Data.Core.TypedBindingExpression isExpanded = {unknown}) C# Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Models.TreeDataGrid.HierarchicalExpanderColumn`1.CreateCell(Avalonia.Controls.Models.TreeDataGrid.IRow row = {unknown}) C# Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Primitives.TreeDataGridCellsPresenter.GetElementFromFactory(Avalonia.Controls.Models.TreeDataGrid.IColumn column = {unknown}, int index = {unknown}) C# Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Primitives.TreeDataGridPresenterBase`1.GetRecycledOrCreateElement(int index = {unknown}) C# Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Primitives.TreeDataGridPresenterBase`1.GenerateElements(Avalonia.Size availableSize = {unknown}, ref MeasureViewport viewport = {unknown}) C# Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Primitives.TreeDataGridPresenterBase`1.MeasureOverride(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.LayoutHelper.MeasureChild(Avalonia.Layout.ILayoutable control = {unknown}, Avalonia.Size availableSize = {unknown}, Avalonia.Thickness padding = {unknown}, Avalonia.Thickness borderThickness = {unknown}) C# Avalonia.Controls.dll!Avalonia.Controls.Border.MeasureOverride(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureOverride(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Primitives.TreeDataGridPresenterBase`1.MeasureElement(int index = {unknown}, Avalonia.Controls.IControl element = {unknown}, Avalonia.Size availableSize = {unknown}) C# Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Primitives.TreeDataGridPresenterBase`1.GenerateElements(Avalonia.Size availableSize = {unknown}, ref MeasureViewport viewport = {unknown}) C# Avalonia.Controls.TreeDataGrid.dll!Avalonia.Controls.Primitives.TreeDataGridPresenterBase`1.MeasureOverride(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Controls.dll!Avalonia.Controls.Presenters.ScrollContentPresenter.MeasureOverride(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Controls.dll!Avalonia.Controls.Grid.MeasureCell(int cell = {unknown}, bool forceInfinityV = {unknown}) C# Avalonia.Controls.dll!Avalonia.Controls.Grid.MeasureCellsGroup(int cellsHead = {unknown}, Avalonia.Size referenceSize = {unknown}, bool ignoreDesiredSizeU = {unknown}, bool forceInfinityV = {unknown}, out bool hasDesiredSizeUChanged = {unknown}) C# Avalonia.Controls.dll!Avalonia.Controls.Grid.MeasureOverride(Avalonia.Size constraint = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureOverride(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Controls.dll!Avalonia.Controls.DockPanel.MeasureOverride(Avalonia.Size constraint = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.LayoutHelper.MeasureChild(Avalonia.Layout.ILayoutable control = {unknown}, Avalonia.Size availableSize = {unknown}, Avalonia.Thickness padding = {unknown}, Avalonia.Thickness borderThickness = {unknown}) C# Avalonia.Controls.dll!Avalonia.Controls.Border.MeasureOverride(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureOverride(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Controls.dll!Avalonia.Controls.StackPanel.MeasureOverride(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.LayoutHelper.MeasureChild(Avalonia.Layout.ILayoutable control = {unknown}, Avalonia.Size availableSize = {unknown}, Avalonia.Thickness padding = {unknown}, Avalonia.Thickness borderThickness = {unknown}) C# Avalonia.Controls.dll!Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.LayoutHelper.MeasureChild(Avalonia.Layout.ILayoutable control = {unknown}, Avalonia.Size availableSize = {unknown}, Avalonia.Thickness padding = {unknown}) C# Avalonia.Controls.dll!Avalonia.Controls.Primitives.VisualLayerManager.MeasureOverride(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureOverride(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.MeasureOverride(Avalonia.Size availableSize = {unknown}) C# Avalonia.Controls.dll!Avalonia.Controls.Window.MeasureOverride(Avalonia.Size availableSize = {unknown}) C# Avalonia.Controls.dll!Avalonia.Controls.WindowBase.MeasureCore(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.Layoutable.Measure(Avalonia.Size availableSize = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.LayoutManager.Measure(Avalonia.Layout.ILayoutable control = {unknown}) C# Avalonia.Base.dll!Avalonia.Layout.LayoutManager.ExecuteInitialLayoutPass() C# Avalonia.Controls.dll!Avalonia.Controls.Window.ShowDialog(Avalonia.Controls.Window owner = {unknown}) C# > treedatagrid-bug.dll!<Dialog>d__1.MoveNext() C# System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start(TStateMachine stateMachine = {unknown}) C# System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start(TStateMachine stateMachine = {unknown}) C# treedatagrid-bug.dll!treedatagrid_bug.Views.MainWindow.Dialog(ReactiveUI.InteractionContext<string,string> Interaction = {unknown}) C# ReactiveUI.dll!<>c__DisplayClass5_0.AnonymousMethod(ReactiveUI.InteractionContext interaction = {unknown}) C# ReactiveUI.dll!<>c__DisplayClass6_0`1.<RegisterHandler>g__ContentHandler|0(ReactiveUI.InteractionContext context = {unknown}) C# System.Reactive.dll!_.Run() C# System.Reactive.dll!System.Reactive.Producer`2.SubscribeRaw(System.IObserver observer = {unknown}, bool enableSafeguard = {unknown}) C# System.Reactive.dll!ConcatManyOuterObserver.Drain() C# System.Reactive.dll!System.Reactive.ObserveOnObserverNew`1.DrainStep(System.Collections.Concurrent.ConcurrentQueue q = {unknown}) C# System.Reactive.dll!System.Reactive.ObserveOnObserverNew`1.DrainShortRunning(System.Reactive.Concurrency.IScheduler recursiveScheduler = {unknown}) C# System.Reactive.dll!Trampoline.Run(System.Reactive.Concurrency.SchedulerQueue<System.TimeSpan> queue = {unknown}) C# System.Reactive.dll!System.Reactive.Concurrency.CurrentThreadScheduler.Schedule(TState state = {unknown}, System.TimeSpan dueTime = {unknown}, System.Func action = {unknown}) C# System.Reactive.dll!System.Reactive.Concurrency.Scheduler.ScheduleAction(System.Reactive.Concurrency.IScheduler scheduler = {unknown}, TState state = {unknown}, System.Action action = {unknown}) C# System.Reactive.dll!System.Reactive.Producer`2.SubscribeRaw(System.IObserver observer = {unknown}, bool enableSafeguard = {unknown}) C# System.Reactive.dll!System.Reactive.Linq.QueryLanguage.RunAsync(System.IObservable source = {unknown}, System.Threading.CancellationToken cancellationToken = {unknown}) C# System.Reactive.dll!System.Reactive.Linq.QueryLanguage.GetAwaiter(System.IObservable source = {unknown}) C# treedatagrid-bug.dll!<<-ctor>b__12_0>d.MoveNext() C# System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start(TStateMachine stateMachine = {unknown}) C# System.Private.CoreLib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start(TStateMachine stateMachine = {unknown}) C# treedatagrid-bug.dll!treedatagrid_bug.ViewModels.MainWindowViewModel.AnonymousMethod() C# ReactiveUI.dll!<>c__DisplayClass9_0.AnonymousMethod() C# ReactiveUI.dll!ReactiveUI.ReactiveCommand`2.Execute(TParam parameter = {unknown}) C# ReactiveUI.dll!ReactiveUI.ReactiveCommandBase`2.ICommandExecute([An error occurred while fetching the data for this event]) C# Avalonia.Controls.dll!Avalonia.Controls.Button.OnClick() C# Avalonia.Controls.dll!Avalonia.Controls.Button.OnPointerReleased(Avalonia.Input.PointerReleasedEventArgs e = {unknown}) C# System.Reactive.dll!System.Reactive.Subjects.Subject`1.OnNext(T value = {unknown}) C# Avalonia.Base.dll!Avalonia.Interactivity.EventRoute.RaiseEventImpl(Avalonia.Interactivity.RoutedEventArgs e = {unknown}) C# Avalonia.Base.dll!Avalonia.Interactivity.EventRoute.RaiseEvent(Avalonia.Interactivity.IInteractive source = {unknown}, Avalonia.Interactivity.RoutedEventArgs e = {unknown}) C# Avalonia.Base.dll!Avalonia.Interactivity.Interactive.RaiseEvent(Avalonia.Interactivity.RoutedEventArgs e = {unknown}) C# Avalonia.Base.dll!Avalonia.Input.MouseDevice.MouseUp(Avalonia.Input.IMouseDevice device = {unknown}, ulong timestamp = {unknown}, Avalonia.Input.IInputRoot root = {unknown}, Avalonia.Point p = {unknown}, Avalonia.Input.PointerPointProperties props = {unknown}, Avalonia.Input.KeyModifiers inputModifiers = {unknown}, Avalonia.Input.IInputElement hitTest = {unknown}) C# Avalonia.Base.dll!Avalonia.Input.MouseDevice.ProcessRawEvent(Avalonia.Input.Raw.RawPointerEventArgs e = {unknown}) C# Avalonia.Base.dll!Avalonia.Input.InputManager.ProcessInput(Avalonia.Input.Raw.RawInputEventArgs e = {unknown}) C# Avalonia.Controls.dll!Avalonia.Controls.TopLevel.HandleInput(Avalonia.Input.Raw.RawInputEventArgs e = {unknown}) C# Avalonia.Win32.dll!Avalonia.Win32.WindowImpl.AppWndProc(System.IntPtr hWnd = {unknown}, uint msg = {unknown}, System.IntPtr wParam = {unknown}, System.IntPtr lParam = {unknown}) C# Avalonia.Win32.dll!Avalonia.Win32.WindowImpl.WndProc(System.IntPtr hWnd = {unknown}, uint msg = {unknown}, System.IntPtr wParam = {unknown}, System.IntPtr lParam = {unknown}) C# Avalonia.Win32.dll!Avalonia.Win32.Win32Platform.RunLoop(System.Threading.CancellationToken cancellationToken = {unknown}) C# Avalonia.Base.dll!Avalonia.Threading.Dispatcher.MainLoop(System.Threading.CancellationToken cancellationToken = {unknown}) C# Avalonia.Controls.dll!Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(string[] args = {unknown}) C# treedatagrid-bug.dll!treedatagrid_bug.Program.Main(string[] args = {unknown}) C#
Desktop:
Fixed by changing ChildViewModel.cs:28 to public Item RootItem { get; set; } = new Item();
Describe the bug Exception is thrown upon rendering a new window with
TreeDataGrid
without clear explanation of what went wrongTo Reproduce Steps to reproduce the behavior:
treedatagrid-bug.zip
Expected behavior No exception or exception explaining incorrect usage
Stacktrace
Desktop: