Inheritance: global::Windows.UI.Xaml.DependencyObject
 /// <summary>
 /// Create the actual storyboard that will be used to animate the transition. Use all previously calculated results.
 /// </summary>
 /// <param name="duration">The duration of the animation</param>
 /// <param name="ease">The easing function to be used in the animation</param>
 /// <param name="movingElements">The set of elements that will be moving</param>
 /// <param name="oldOpacities">The old opacities of the elements whose viisibility is changing</param>
 /// <returns>The storyboard</returns>
 private static Storyboard CreateLayoutTransitionStoryboard(VisualTransition transition, List<FrameworkElement> movingElements, Dictionary<FrameworkElement, double> oldOpacities)
 {
     Duration duration = (transition != null) ? transition.GeneratedDuration : new Duration(TimeSpan.Zero);
     EasingFunctionBase function = (transition != null) ? transition.GeneratedEasingFunction : null;
     Storyboard storyboard = new Storyboard
     {
         Duration = duration
     };
     foreach (FrameworkElement element in movingElements)
     {
         WrapperCanvas parent = element.Parent as WrapperCanvas;
         if (parent != null)
         {
             DoubleAnimation timeline = new DoubleAnimation
             {
                 From = 1.0,
                 To = 0.0,
                 Duration = duration,
                 EasingFunction = function
             };
             Storyboard.SetTarget(timeline, parent);
             Storyboard.SetTargetProperty(timeline, "SimulationProgress" /*WrapperCanvas.SimulationProgressProperty*/);
             storyboard.Children.Add(timeline);
             parent.SimulationProgress = 1.0;
             Rect newRect = parent.NewRect;
             if (!IsClose(parent.Width, newRect.Width))
             {
                 DoubleAnimation animation3 = new DoubleAnimation
                 {
                     From = new double?(newRect.Width),
                     To = new double?(newRect.Width),
                     Duration = duration
                 };
                 Storyboard.SetTarget(animation3, parent);
                 Storyboard.SetTargetProperty(animation3, "Width" /*FrameworkElement.WidthProperty*/);
                 storyboard.Children.Add(animation3);
             }
             if (!IsClose(parent.Height, newRect.Height))
             {
                 DoubleAnimation animation5 = new DoubleAnimation
                 {
                     From = new double?(newRect.Height),
                     To = new double?(newRect.Height),
                     Duration = duration
                 };
                 Storyboard.SetTarget(animation5, parent);
                 Storyboard.SetTargetProperty(animation5, "Height" /*FrameworkElement.HeightProperty*/);
                 storyboard.Children.Add(animation5);
             }
             if (parent.DestinationVisibilityCache == Visibility.Collapsed)
             {
                 Thickness margin = parent.Margin;
                 if ((!IsClose(margin.Left, 0.0) || !IsClose(margin.Top, 0.0)) || (!IsClose(margin.Right, 0.0) || !IsClose(margin.Bottom, 0.0)))
                 {
                     ObjectAnimationUsingKeyFrames frames = new ObjectAnimationUsingKeyFrames
                     {
                         Duration = duration
                     };
                     DiscreteObjectKeyFrame frame2 = new DiscreteObjectKeyFrame
                     {
                         KeyTime = TimeSpan.Zero
                     };
                     Thickness thickness2 = new Thickness();
                     frame2.Value = thickness2;
                     DiscreteObjectKeyFrame frame = frame2;
                     frames.KeyFrames.Add(frame);
                     Storyboard.SetTarget(frames, parent);
                     Storyboard.SetTargetProperty(frames, "Margin" /*FrameworkElement.MarginProperty*/);
                     storyboard.Children.Add(frames);
                 }
                 if (!IsClose(parent.MinWidth, 0.0))
                 {
                     DoubleAnimation animation7 = new DoubleAnimation
                     {
                         From = 0.0,
                         To = 0.0,
                         Duration = duration
                     };
                     Storyboard.SetTarget(animation7, parent);
                     Storyboard.SetTargetProperty(animation7, "MinWidth" /*FrameworkElement.MinWidthProperty*/);
                     storyboard.Children.Add(animation7);
                 }
                 if (!IsClose(parent.MinHeight, 0.0))
                 {
                     DoubleAnimation animation9 = new DoubleAnimation
                     {
                         From = 0.0,
                         To = 0.0,
                         Duration = duration
                     };
                     Storyboard.SetTarget(animation9, parent);
                     Storyboard.SetTargetProperty(animation9, "MinHeight" /*FrameworkElement.MinHeightProperty*/);
                     storyboard.Children.Add(animation9);
                 }
             }
         }
     }
     foreach (FrameworkElement element2 in oldOpacities.Keys)
     {
         WrapperCanvas target = element2.Parent as WrapperCanvas;
         if (target != null)
         {
             double a = oldOpacities[element2];
             double num2 = (target.DestinationVisibilityCache == Visibility.Visible) ? 1.0 : 0.0;
             if (!IsClose(a, 1.0) || !IsClose(num2, 1.0))
             {
                 DoubleAnimation animation11 = new DoubleAnimation
                 {
                     From = new double?(a),
                     To = new double?(num2),
                     Duration = duration,
                     EasingFunction = function
                 };
                 Storyboard.SetTarget(animation11, target);
                 Storyboard.SetTargetProperty(animation11, "Opacity" /*UIElement.OpacityProperty*/);
                 storyboard.Children.Add(animation11);
             }
         }
     }
     return storyboard;
 }