-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Detaching ItemsControl multiple times crashes #3487
Labels
Comments
MarchingCube
changed the title
Detaching ItemsControl crashes
Detaching ItemsControl multiple times crashes
Jan 28, 2020
Ok, worked out what's happening here:
This is very similar to #3328, but with a different cause. It only occurs in |
grokys
added a commit
that referenced
this issue
Feb 11, 2020
Exposing the `ContentPresenter.Child` in `ItemsControl.LogicalChildren` was causing problems when detaching and reattaching an `ItemsControl` to the logical tree. Instead, expose the `ContentPresenter` itself in effect meaning that `ItemsControl` has a "container" type just like the controls derived from it. Fixes #3487
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've found out that detaching
ItemsControl
from the parent and then attaching it to the same parent again will crash it when we try to detach again.Managed to reproduce it in ControlCatalog with such codebehind:
And XAML:
After calling
MovePanel
once all items inItemsControl
will getParent
set tonull
. Second call will crash with: https://gist.github.com/MarchingCube/055e69b9737157f986fec5334de0d127The text was updated successfully, but these errors were encountered: