public static Storyboard GetAnimation(UIElement element, TurnstileTransitionMode mode) { if (!(element.Projection is PlaneProjection)) { element.Projection = new PlaneProjection { CenterOfRotationX = 0.0 }; } if (mode == TurnstileTransitionMode.ForwardIn) { return(ForwardIn(element)); } if (mode == TurnstileTransitionMode.ForwardOut) { return(ForwardOut(element)); } if (mode == TurnstileTransitionMode.BackwardIn) { return(BackwardIn(element)); } return(BackwardOut(element)); }
private TurnstileTransition TurnstileTransitionElement(string mode) { TurnstileTransitionMode turnstileTransitionMode = (TurnstileTransitionMode)Enum.Parse(typeof(TurnstileTransitionMode), mode, false); return(new TurnstileTransition { Mode = turnstileTransitionMode }); }
/// <summary> /// Creates an /// <see cref="T:Microsoft.Phone.Controls.ITransition"/> /// for a /// <see cref="T:System.Windows.UIElement"/> /// for the turnstile transition family. /// </summary> /// <param name="element">The <see cref="T:System.Windows.UIElement"/>.</param> /// <param name="turnstileTransitionMode">The transition mode.</param> /// <returns>The <see cref="T:Microsoft.Phone.Controls.ITransition"/>.</returns> public static ITransition Turnstile(UIElement element, TurnstileTransitionMode turnstileTransitionMode) { if (element == null) { throw new ArgumentNullException("element"); } if (!Enum.IsDefined(typeof(TurnstileTransitionMode), turnstileTransitionMode)) { throw new ArgumentOutOfRangeException("turnstileTransitionMode"); } element.Projection = new PlaneProjection { CenterOfRotationX = 0 }; return(GetEnumStoryboard <TurnstileTransitionMode>(element, "Turnstile", turnstileTransitionMode)); }