Storyboard completed
-
Thursday, April 08, 2010 8:03 PM
I seem to be getting in to my storyboard completed event multiple times, can anyone help me with this issue - here is the code I do to start the storyboard:
private void SurfaceWindow_PreviewContactHoldGesture(object sender, ContactEventArgs e)
{
currentSB = (Storyboard)FindResource("wipeTransition");
currentSB.Completed += new EventHandler(sb_Completed);
currentSB.Begin(myUserControl);
}
void sb_Completed(object sender, EventArgs e)
Object obj = loadFile(fileName);
if (obj != null)
}
Thanks
{
addObjectToUsercontrol(obj);
{
Thanks
All Replies
-
Monday, May 17, 2010 11:33 PM
It looks like you are adding a handler for the storyboard Completed event each time you get a PreviewContactHoldGesture event. If you add multiple event handlers, you'll get multiple events. Try putting these two lines:
currentSB = (Storyboard)FindResource("wipeTransition");
currentSB.Completed += new EventHandler(sb_Completed);
in another place that only gets called once, or at least use a flag to indicate you've already added it once.
Doug
- Proposed As Answer by Doug Kramer - SurfaceMicrosoft Employee Monday, May 17, 2010 11:33 PM
- Marked As Answer by rgarf Tuesday, May 18, 2010 3:08 AM

