Esempio n. 1
0
 private static void TiltReturnStoryboard_Completed(object sender, EventArgs e)
 {
     if (TiltEffect.wasPauseAnimation)
     {
         TiltEffect.ResetTiltEffect(TiltEffect.currentTiltElement);
     }
     else
     {
         TiltEffect.StopTiltReturnStoryboardAndCleanup();
     }
 }
Esempio n. 2
0
 private static void BeginTiltEffect(FrameworkElement element, Point touchPoint, Point centerPoint, Point centerDelta)
 {
     if (TiltEffect.tiltReturnStoryboard != null)
     {
         TiltEffect.StopTiltReturnStoryboardAndCleanup();
     }
     if (!TiltEffect.PrepareControlForTilt(element, centerDelta))
     {
         return;
     }
     TiltEffect.currentTiltElement       = element;
     TiltEffect.currentTiltElementCenter = centerPoint;
     TiltEffect.PrepareTiltReturnStoryboard(element);
     TiltEffect.ApplyTiltEffect(TiltEffect.currentTiltElement, touchPoint, TiltEffect.currentTiltElementCenter);
 }
Esempio n. 3
0
 private static void EndTiltEffect(FrameworkElement element)
 {
     if (element != null)
     {
         element.ManipulationCompleted -= new EventHandler <ManipulationCompletedEventArgs>(TiltEffect.TiltEffect_ManipulationCompleted);
         element.ManipulationDelta     -= new EventHandler <ManipulationDeltaEventArgs>(TiltEffect.TiltEffect_ManipulationDelta);
     }
     if (TiltEffect.tiltReturnStoryboard != null)
     {
         TiltEffect.wasPauseAnimation = false;
         if (TiltEffect.tiltReturnStoryboard.GetCurrentState() == ClockState.Active)
         {
             return;
         }
         TiltEffect.tiltReturnStoryboard.Begin();
     }
     else
     {
         TiltEffect.StopTiltReturnStoryboardAndCleanup();
     }
 }