Hi,
I have a list box that I'm trying to populate with a list of viewboxes. The listbox takes in the list without a problem. However, when my function reaches its end, I receive the error:
"Must disconnect specified child from current parent Visual before attaching to new parent Visual."
The viewboxes are created from the same initial viewbox and then edited, which I believe may be my problem.
for(...)
{
Viewbox newviewbox = (Viewbox)myViewbox; //myViewbox created in XAML
// edits newviewbox here
viewboxlist.Add(newviewbox); //viewboxlist created upon initialization
newviewbox = null;
}
myListBox.ItemsSource = viewboxlist;
Any advice is greatly appreciated.
Thanks.