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
The DataContext of the ListBoxItem is still set after a ClearItemContainer when the ListBox is virtualized
To Reproduce
In this repo, the sample VirtualizationImages has a Listbox Virtualized.
Zoom out to realize more elements, then zoom in. Then inspect the visual tree on the ListBoxItem cleared. the datacontext is still set on ListBoxItem but the ContentPresenter is empty
Expected behavior
The ListBoxItem Datacontext should be set to null on cleared items.
Be careful, the ContainerClearing event should be invoke before the ClearContainerForItemOverride to be able to work on the DataContext before clearing. Or you can add another event BeforeContainerClearing or something like this.
Describe the bug
The DataContext of the ListBoxItem is still set after a ClearItemContainer when the ListBox is virtualized
To Reproduce
In this repo, the sample VirtualizationImages has a Listbox Virtualized.
Zoom out to realize more elements, then zoom in. Then inspect the visual tree on the ListBoxItem cleared. the datacontext is still set on ListBoxItem but the ContentPresenter is empty
Expected behavior
The ListBoxItem Datacontext should be set to null on cleared items.
Be careful, the ContainerClearing event should be invoke before the ClearContainerForItemOverride to be able to work on the DataContext before clearing. Or you can add another event BeforeContainerClearing or something like this.
Current ItemsControl.ClearItemContainer :
Avalonia version
11.0.11
OS
Windows, macOS
Additional context
No response
The text was updated successfully, but these errors were encountered: