Weird slowdown in plugin...maybe event issue?

So when the user updates a value in my WPF UI, I do a few things, raise INotifyPropertyChanged, and then will finish and go back to idle. But I noticed that once my application gets large (lots of data), that when this update and notify (which occurs in the setter of the databound property) finishes, there is a hang (> 10 seconds). I added an event handler for the “ValueChanged” of the property, and this triggers after the setter (as expected) and then it hangs. In VS I have “step over properties” and just my code unchecked, but I still can’t step any farther to see what is causing the hang. Which suggests it is external (IE rhino) code. But the hang does seem to be dependant on the size of my data. I handle a number of rhino events, but I don’t think this is one of those. I have multiple display conduits, but those have already run before the end of the setter. I also handle the add / remove / replace regime, but this is not a case of that, as it was simply a UI update.

To make matters weirder, the hang does seem different on different controls in my app, even though it is occurring after the relevant code. Its almost like a cached update or something…but again, its not my code. Any ideas how to debug? I wish I could post some code but this is impossible to break out. The two different setters call similar code, and it takes a similar (~5 seconds) to do its thing. This hang is after the closure on the setter. When it happens, you can see one core load up to 100% in VS for about 10 secs (but much less in the case of the other property). The file doesn’t appear to be saving or anything (I do have userdata overrides as well, but I could step through those if that were the case). I also have xml writers going on, but they have been called and have returned before the hang. Its a single threaded app. I am totally stumped. Could it be another event? As a test, I added a handler to RhinoApp.OnIdle. This breakpoint hits AFTER the hang (when it finished doing …whatever it was doing…)

If you are adding or changing geometry in the document, it could be that creating a new render mesh is hanging your program. Have you tried this in wireframe display mode? Then you should not see any slow down.

I will compare while in wireframe. I am not adding to the document though, so I suspect this isn’t the issue. I have had trouble reproducing the issue in all cases anyway; rhino runs out of memory in some cases but doesn’t trigger a protected memory fault in VS.