0

WPF Helix Toolkit MVVM Exception "...Child of another Visual Tree"

claude 3 months ago in Question • updated by Happy Todd 2 months ago 1

In my project i am trying to integrate some 3D Visualization using Helix Toolkit. A Page showing a ViewPort3D with itemSource bound to a DataContext with an ObservableCollection of Visual3D is one of several Pages which can be displayed in my Application. A Navigation bar lets me switch between these pages.

My problem is that once i have populated my ObservableCollection with Visual3Ds, then navigate to a different page, then return and try to make changes to the ObservableCollection again, I constantly receive an Exception that my collection is already part of another VisualTree!

Presumably, since a new View is instanciated (and presumably the old View still survives somehow)whenever i navigate between pages, but my DataContext is persistant, this is what causes the problem. 

Has anyone come across this problem? Sorry for the rough explanation but my Software is too large to post!

Regards

es I am facing the same problem. Every time I receive a massage that my collection is already exist. Can anyone help me resolve the issue.

Personalised baby t shirtBaby romper in Singapore