Esempio n. 1
0
 /// <summary>
 /// Flips the item using one of two storyboards, front to back or
 /// back to front.
 /// </summary>
 public void Flip(double startDelayMs = 0)
 {
     if (!App.ViewModel.FlipFavourites || BackImage == null || BackImage.Length <= 0)
     {
         return;
     }
     try
     {
         // Start the flipping animation after the specified duration.
         TimeSpan startTime = TimeSpan.FromMilliseconds(startDelayMs);
         if (backSideShown)
         {
             FlipBackToFrontSB.BeginTime = startTime;
             FlipBackToFrontSB.Begin();
             FlipBackToFrontSB.Completed += (sender, args) => backSideShown = false;
         }
         else
         {
             FlipFrontToBackSB.BeginTime = startTime;
             FlipFrontToBackSB.Begin();
             FlipFrontToBackSB.Completed += (sender, args) => backSideShown = true;
         }
     }
     catch (Exception /*ex*/)
     {
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Stops currently ongoing flip animation.
 /// </summary>
 public void Stop()
 {
     try
     {
         FlipFrontToBackSB.Stop();
         FlipBackToFrontSB.Stop();
         backSideShown = false;
     }
     catch (Exception /*ex*/)
     {
     }
 }