StackOverflowException in PresentationCore.dll
-
I wrote a simple application in WPf and I`m getting StackOverflowException in PresentationCore.dll. It seems to be WPF bug. It`s impossible to debug or trace the cause, since exception occurs not in my code. I`m attaching the sample application which produces this exception (http://62.233.162.212/martinez/SMOG/Sample%20application.rar[^]) How to produce this exception in this application: 1. The application initially contains 2 polygons. Enlarge the "brown" one a bit 2. Turn off snaping (upper-left corner checkbox) 3. Insert the second polygon inside the former one 4. Move the bigger polygon one or two times - it always throws this exception. Thank you very much for any help
-
I wrote a simple application in WPf and I`m getting StackOverflowException in PresentationCore.dll. It seems to be WPF bug. It`s impossible to debug or trace the cause, since exception occurs not in my code. I`m attaching the sample application which produces this exception (http://62.233.162.212/martinez/SMOG/Sample%20application.rar[^]) How to produce this exception in this application: 1. The application initially contains 2 polygons. Enlarge the "brown" one a bit 2. Turn off snaping (upper-left corner checkbox) 3. Insert the second polygon inside the former one 4. Move the bigger polygon one or two times - it always throws this exception. Thank you very much for any help
The problem isn't with WPF. It's your code that's at fault - basically you have entered an infinite loop in MovePolygon where you execute this section:
foreach (var item in children)
{
item.MovePolygon(xDestination, yDestination);
}You seem to be iterating through the same item every time, and I'm guessing this isn't the effect that you want.
Deja View - the feeling that you've seen this post before.