At the moment I am trying to assing a new value to one of canvas' children in wpf and it throws the exeption above I have the following code which I think is relavent:
var val = comps[0].GetComponent();
c.Children[comps[0].Index] = val;
Intrestingly the problem self-resolves when I do this:
var val = comps[0].GetComponent();
c.Children.RemoveAt(comps[0].Index);
c.Children.Insert(comps[0].Index, val);
but I want to understand whats happening and if there is a more efficient way of preventing the exeption