Example #1
0
 private Action CreateChainedAnimationAction(Animation animation, UIViewAnimationOptions options, Action nextAction)
 {
     if (animation.IsActionOnly)
     {
         return(() =>
         {
             animation.Action();
             if (nextAction != null)
             {
                 nextAction();
             }
             else
             {
                 if (_whenCompleteAction != null)
                 {
                     _whenCompleteAction();
                 }
                 if (_repeaterAction != null)
                 {
                     _repeaterAction();
                 }
             }
         });
     }
     return(() =>
            UIView.Animate(animation.Duration, animation.Delay, options,
                           () => animation.Action(),
                           () =>
     {
         if (nextAction != null)
         {
             nextAction();
         }
         else
         {
             if (_whenCompleteAction != null)
             {
                 _whenCompleteAction();
             }
             if (_repeaterAction != null)
             {
                 _repeaterAction();
             }
         }
     }));
 }
 private Action CreateChainedAnimationAction(Animation animation, UIViewAnimationOptions options, Action nextAction)
 {
     if (animation.IsActionOnly)
     {
         return () =>
         {
             animation.Action();
             if (nextAction != null) nextAction();
             else
             {
                 if (_whenCompleteAction != null) _whenCompleteAction();
                 if (_repeaterAction != null) _repeaterAction();
             }
         };
     }
     return () =>
             UIView.Animate(animation.Duration, animation.Delay, options,
                            () => animation.Action(),
                            () =>
                            {
                                if (nextAction != null) nextAction();
                                else
                                {
                                    if (_whenCompleteAction != null) _whenCompleteAction();
                                    if (_repeaterAction != null) _repeaterAction();
                                }
                            });
 }