I came accross a strange problem in my app I wasn't able to reproduce for some time but now I might found the issue. Ocassionally, I got "Cannot resolve target name xxx" exceptions during playing animations (triggered by a DataStateBehavior) while I was sure that the target name exists - because most of the time, everythign works fine.
Now, the DataStateBehavior that triggers the animation that animates the control with the not found target name, is inside an ItemTemplate of a RadJumpList. The animation plays when an item gets marked read by the user. It seems that the following happens:
- Opening a list with a few hundret items seems to work fine. If the user selects the function "mark all read", what will trigger the animation inside all of the items, work fine!
- Scrolling down a bit, opening an item, going back to the list, marking all as read - still everythings fine.
- But if I start scrolling far down the list, i.e. to the end and so a few hundred items down and THEN hit "mark all read", this exception appears.
So, my theory is: when items get added to the view during scrolling down due to JumpList's virtualization handling, that works fine. But while going down, AFAIK JumpLists starts to remove items you have passed again from the actual view/list and "virutalizes" them.
It seems that this happens only partional for some reason, the DataStateBehavior (I use the one that comes with Expression Blend's Interactivity assemblies) still seems to fire data state changes inside the again-virtualized items, what triggers an animation and this animation cannot find the target names of the animation targets specified in the animation as the items aren't really inside the list anymore.
Okay, so far my theory but my question is: can this be the case? I don't want to say that this is actually a bug of the JumpList but you know, it seems my problem has at least something to do with it.
It wold be great if you can confirm that this can be the source of my problem here and maybe with your Silverlight expert knowledge, can come up with some solution how I could prevent this behavior?
Any help would be greatly appreciated :)
Thanks,
Bernhard