private void animateSelection(double x, double y, SlideElem obj) { if (obj.Equals(SlideElem.upperRightHotCorner)) { if (topRT == null) { InitializeRT(); } topRT.BeginAnimation(RotateTransform.AngleProperty, topDA); } if (obj.Equals(SlideElem.lowerLeftHotCorner)) { if (lowerRT == null) { InitializeRT(); } lowerRT.BeginAnimation(RotateTransform.AngleProperty, lowerDA); } //da.RepeatBehavior = RepeatBehavior.Forever; //rt.BeginAnimation(RotateTransform.AngleProperty, da); var animateRelatedItem = Resources["AnimateRelatedItem"] as Storyboard; var animatePlayButton = Resources["AnimatePlayButton"] as Storyboard; if (relatedItemsDown && y < RelatedItems.ActualHeight) { //double SLIDE_WIDTH = 220; int relatedSlideIndex = ((int)(x) / (int)SLIDE_WIDTH); if (relatedSlideIndex < p.getCurrentSlide().getAllAssociated().Count) //TEMPORARY.... SHOULD BE < 5 { Canvas.SetLeft(relatedImageOverlay, SLIDE_WIDTH * relatedSlideIndex - 10 * (relatedSlideIndex)); if (animateRelatedItem != null) { animateRelatedItem.Begin(this, true); } } } else if (p.getCurrentSlide().hasVideo() && isInPlayButton(x, y)) { if (animatePlayButton != null) { animatePlayButton.Begin(this, true); } } else { if (animatePlayButton != null) { animateRelatedItem.Stop(this); animatePlayButton.Stop(this); animatePlayButton.FillBehavior = FillBehavior.Stop; } } }