You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When switching a tab in TabControl, the open TablItem is detached from the visual tree. Some child items of this TablItem try to redraw due to axaml binding, which causes an error to occur
Avalonia.AvaloniaInternalException
HResult=0x80131500
Message=Visual is atached to visual tree but root could not be found.
Source=Avalonia.Base
StackTrace:
at Avalonia.Visual.SetVisualParent(Visual value)
at Avalonia.Visual.SetVisualParent(IList children, Visual parent)
at Avalonia.Visual.VisualChildrenChanged(Object sender, NotifyCollectionChangedEventArgs e)
at Avalonia.Collections.AvaloniaList`1.Add(T item)
at Avalonia.Controls.Presenters.ContentPresenter.UpdateChild(Object content)
at Avalonia.Controls.Presenters.ContentPresenter.UpdateChild()
at Avalonia.Controls.Presenters.ContentPresenter.ContentChanged(AvaloniaPropertyChangedEventArgs e)
at Avalonia.Controls.Presenters.ContentPresenter.OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
at Avalonia.Animation.Animatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs change)
at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty`1 property, Optional`1 oldValue, BindingValue`1 newValue, BindingPriority priority, Boolean isEffectiveValue)
at Avalonia.PropertyStore.EffectiveValue`1.SetAndRaiseCore(ValueStore owner, StyledProperty`1 property, T value, BindingPriority priority, Boolean isOverriddenCurrentValue, Boolean isCoercedDefaultValue)
at Avalonia.PropertyStore.EffectiveValue`1.SetAndRaise(ValueStore owner, IValueEntry value, BindingPriority priority)
at Avalonia.PropertyStore.ValueStore.ReevaluateEffectiveValue(AvaloniaProperty property, EffectiveValue current, IValueEntry changedValueEntry, Boolean ignoreLocalValue)
at Avalonia.Styling.Activators.StyleActivatorBase.ReevaluateIsActive()
at Avalonia.Styling.Activators.PropertyEqualsActivator.System.IObserver<System.Object>.OnNext(Object value)
at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value)
at Avalonia.Reactive.AvaloniaPropertyObservable`2.PublishNewValue(TResult newValue)
at Avalonia.Reactive.AvaloniaPropertyObservable`2.PropertyChanged(Object sender, AvaloniaPropertyChangedEventArgs e)
at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty`1 property, Optional`1 oldValue, BindingValue`1 newValue, BindingPriority priority, Boolean isEffectiveValue)
at Avalonia.PropertyStore.EffectiveValue`1.RaiseInheritedValueChanged(AvaloniaObject owner, AvaloniaProperty property, EffectiveValue oldValue, EffectiveValue newValue)
at Avalonia.PropertyStore.ValueStore.InheritedValueChanged(AvaloniaProperty property, EffectiveValue oldValue, EffectiveValue newValue)
at Avalonia.PropertyStore.ValueStore.InheritedValueChanged(AvaloniaProperty property, EffectiveValue oldValue, EffectiveValue newValue)
at Avalonia.PropertyStore.ValueStore.SetInheritanceParent(AvaloniaObject newParent)
at Avalonia.AvaloniaObject.set_InheritanceParent(AvaloniaObject value)
at Avalonia.StyledElement.Avalonia.Controls.ISetLogicalParent.SetParent(ILogical parent)
at Avalonia.StyledElement.ClearLogicalParent(IList children)
at Avalonia.StyledElement.LogicalChildrenCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at Avalonia.Visual.LogicalChildrenCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at Avalonia.Collections.AvaloniaList`1.NotifyRemove(T item, Int32 index)
at Avalonia.Collections.AvaloniaList`1.Remove(T item)
at Avalonia.Controls.ItemsControl.RemoveLogicalChild(Control c)
at Avalonia.Controls.Presenters.PanelContainerGenerator.<OnItemsChanged>g__Remove|5_1(Int32 index, Int32 count, <>c__DisplayClass5_0& )
at Avalonia.Controls.Presenters.PanelContainerGenerator.OnItemsChanged(Object sender, NotifyCollectionChangedEventArgs e)
at Avalonia.Controls.ItemsSourceView.RaiseCollectionChanged(NotifyCollectionChangedEventArgs e)
at Avalonia.Controls.ItemCollection.SetSource(IEnumerable source)
at Avalonia.Controls.ItemCollection.SetItemsSource(IEnumerable value)
at Avalonia.Controls.ItemsControl.OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
at Avalonia.Animation.Animatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs change)
at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty`1 property, Optional`1 oldValue, BindingValue`1 newValue, BindingPriority priority, Boolean isEffectiveValue)
at Avalonia.PropertyStore.EffectiveValue`1.SetAndRaiseCore(ValueStore owner, StyledProperty`1 property, T value, BindingPriority priority, Boolean isOverriddenCurrentValue, Boolean isCoercedDefaultValue)
at Avalonia.PropertyStore.EffectiveValue`1.SetLocalValueAndRaise(ValueStore owner, StyledProperty`1 property, T value)
at Avalonia.PropertyStore.ValueStore.SetLocalValue[T](StyledProperty`1 property, T value)
at Avalonia.PropertyStore.LocalValueBindingObserverBase`1.<OnNext>g__Execute|15_0(LocalValueBindingObserverBase`1 instance, BindingValue`1 value)
at Avalonia.PropertyStore.LocalValueBindingObserverBase`1.OnNext(BindingValue`1 value)
at Avalonia.PropertyStore.LocalValueBindingObserver`1.OnNext(Object value)
at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value)
at Avalonia.Data.Core.BindingExpression.InnerListener.OnNext(Object value)
at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value)
at Avalonia.Data.Core.ExpressionObserver.ValueChanged(Object value)
at Avalonia.Data.Core.ExpressionNode.ValueChanged(Object value, Boolean notify)
at Avalonia.Data.Core.ExpressionNode.ValueChanged(Object value)
at Avalonia.Data.Core.ExpressionNode.StartListening()
at Avalonia.Data.Core.ExpressionNode.set_Target(WeakReference`1 value)
at Avalonia.Data.Core.ExpressionObserver.<StartRoot>b__33_0(Object x)
at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value)
at Avalonia.VisualTree.VisualLocator.VisualTracker.AttachedDetached(Object sender, VisualTreeAttachmentEventArgs e)
at Avalonia.Visual.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs e)
at Avalonia.Layout.Layoutable.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs e)
at Avalonia.Input.InputElement.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs e)
at Avalonia.Controls.Control.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs e)
at Avalonia.Visual.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs e)
at Avalonia.Layout.Layoutable.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs e)
at Avalonia.Input.InputElement.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs e)
at Avalonia.Controls.Control.OnDetachedFromVisualTreeCore(VisualTreeAttachmentEventArgs e)
at Avalonia.Visual.SetVisualParent(Visual value)
at Avalonia.Visual.SetVisualParent(IList children, Visual parent)
at Avalonia.Visual.VisualChildrenChanged(Object sender, NotifyCollectionChangedEventArgs e)
at Avalonia.Collections.AvaloniaList`1.NotifyRemove(T item, Int32 index)
at Avalonia.Collections.AvaloniaList`1.Remove(T item)
at Avalonia.Controls.Presenters.ContentPresenter.UpdateChild(Object content)
at Avalonia.Controls.Presenters.ContentPresenter.ContentChanged(AvaloniaPropertyChangedEventArgs e)
at Avalonia.Controls.Presenters.ContentPresenter.OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
at Avalonia.Animation.Animatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs change)
at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty`1 property, Optional`1 oldValue, BindingValue`1 newValue, BindingPriority priority, Boolean isEffectiveValue)
at Avalonia.PropertyStore.EffectiveValue`1.SetAndRaiseCore(ValueStore owner, StyledProperty`1 property, T value, BindingPriority priority, Boolean isOverriddenCurrentValue, Boolean isCoercedDefaultValue)
at Avalonia.PropertyStore.EffectiveValue`1.SetAndRaise(ValueStore owner, IValueEntry value, BindingPriority priority)
at Avalonia.PropertyStore.ValueStore.ReevaluateEffectiveValue(AvaloniaProperty property, EffectiveValue current, IValueEntry changedValueEntry, Boolean ignoreLocalValue)
at Avalonia.PropertyStore.ValueStore.OnBindingValueChanged(IValueEntry entry, BindingPriority priority)
at Avalonia.PropertyStore.BindingEntryBase`2.<SetValue>g__Execute|37_0(BindingEntryBase`2 instance, BindingValue`1 value)
at Avalonia.PropertyStore.BindingEntryBase`2.SetValue(BindingValue`1 value)
at Avalonia.PropertyStore.BindingEntryBase`2.OnNext(TSource value)
at Avalonia.Data.TemplateBinding.PublishValue()
at Avalonia.Data.TemplateBinding.TemplatedParentPropertyChanged(Object sender, AvaloniaPropertyChangedEventArgs e)
at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty`1 property, Optional`1 oldValue, BindingValue`1 newValue, BindingPriority priority, Boolean isEffectiveValue)
at Avalonia.AvaloniaObject.SetAndRaise[T](DirectPropertyBase`1 property, T& field, T value)
at Avalonia.Controls.TabControl.set_SelectedContent(Object value)
at Avalonia.Controls.TabControl.<UpdateSelectedContent>b__45_0(Object v)
at Avalonia.Reactive.AvaloniaPropertyObservable`2.Subscribed(IObserver`1 observer, Boolean first)
at Avalonia.Reactive.LightweightObservableBase`1.Subscribe(IObserver`1 observer)
at Avalonia.Reactive.Observable.Subscribe[T](IObservable`1 source, Action`1 action)
at Avalonia.Controls.TabControl.UpdateSelectedContent(Control container)
at Avalonia.Controls.TabControl.<>c.<.cctor>b__10_0(TabControl x, AvaloniaPropertyChangedEventArgs e)
at Avalonia.AvaloniaObjectExtensions.ClassHandlerObserver`1.OnNext(AvaloniaPropertyChangedEventArgs value)
at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value)
at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty`1 property, Optional`1 oldValue, BindingValue`1 newValue, BindingPriority priority, Boolean isEffectiveValue)
at Avalonia.AvaloniaObject.RaisePropertyChanged[T](DirectPropertyBase`1 property, T oldValue, T newValue)
at Avalonia.Controls.Primitives.SelectingItemsControl.OnSelectionModelPropertyChanged(Object sender, PropertyChangedEventArgs e)
at Avalonia.Controls.Selection.SelectionModel`1.RaisePropertyChanged(String propertyName)
at Avalonia.Controls.Selection.SelectionModel`1.CommitOperation(Operation operation, Boolean raisePropertyChanged)
at Avalonia.Controls.Selection.SelectionModel`1.EndBatchUpdate()
at Avalonia.Controls.Selection.SelectionModelExtensions.BatchUpdateOperation.Dispose()
at Avalonia.Controls.Primitives.SelectingItemsControl.UpdateSelection(Int32 index, Boolean select, Boolean rangeModifier, Boolean toggleModifier, Boolean rightButton, Boolean fromFocus)
at Avalonia.Controls.Primitives.SelectingItemsControl.UpdateSelection(Control container, Boolean select, Boolean rangeModifier, Boolean toggleModifier, Boolean rightButton, Boolean fromFocus)
at Avalonia.Controls.Primitives.SelectingItemsControl.UpdateSelectionFromEventSource(Object eventSource, Boolean select, Boolean rangeModifier, Boolean toggleModifier, Boolean rightButton, Boolean fromFocus)
at Avalonia.Controls.TabControl.OnPointerPressed(PointerPressedEventArgs e)
at Avalonia.Input.InputElement.<>c.<.cctor>b__32_8(InputElement x, PointerPressedEventArgs e)
at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value)
at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e)
at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e)
at Avalonia.Input.MouseDevice.MouseDown(IMouseDevice device, UInt64 timestamp, IInputElement root, Point p, PointerPointProperties properties, KeyModifiers inputModifiers, IInputElement hitTest)
at Avalonia.Input.MouseDevice.ProcessRawEvent(RawPointerEventArgs e)
at Avalonia.Controls.TopLevel.HandleInput(RawInputEventArgs e)
at Avalonia.Win32.WindowImpl.AppWndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
at Avalonia.Win32.WindowImpl.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
at Avalonia.Win32.Win32DispatcherImpl.RunLoop(CancellationToken cancellationToken)
at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl)
at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, Action`1 lifetimeBuilder)
at AvaloniaApplication1.Program.Main(String[] args)
Expected behavior
No response
Avalonia version
11.0.10
OS
Windows
Additional context
in 11.1.0-beta2 error is the same
The text was updated successfully, but these errors were encountered:
idk :) We found this situation in our project. Application works correctly if use TemplateBinding or fill collection from code-behinde.
You can close issue if you want, but someone may encounter the same situation
Describe the bug
When switching a tab in TabControl, the open TablItem is detached from the visual tree. Some child items of this TablItem try to redraw due to axaml binding, which causes an error to occur
To Reproduce
Project for test: Sample.zip
Expected behavior
No response
Avalonia version
11.0.10
OS
Windows
Additional context
in 11.1.0-beta2 error is the same
The text was updated successfully, but these errors were encountered: