public static void BeginVector3Animation(this CompositionObject compObj, string propertyPath, Vector3 to, Vector3?from, TimeSpan duration, TimeSpan?delay, CompositionEasingFunction ease) { compObj.StartAnimation(propertyPath, compObj.Compositor.CreateVector3KeyFrameAnimation(to, from, duration, delay, ease)); }
public static Vector3KeyFrameAnimation CreateVector3KeyFrameAnimation(this Compositor compositor, Vector3 to, Vector3?from, TimeSpan duration, TimeSpan?delay, CompositionEasingFunction ease) { var ani = compositor.CreateVector3KeyFrameAnimation(); // Set duration and delay time ani.Duration = duration; if (delay.HasValue) { ani.DelayTime = delay.Value; } // Insert "to" and "from" keyframes ani.InsertKeyFrame(1, to, ease ?? compositor.CreateLinearEasingFunction()); if (from.HasValue) { ani.InsertKeyFrame(0, from.Value); } return(ani); }
public static void BeginVector3Animation(UIElement element, string propertyPath, Vector3 to, Vector3?from, TimeSpan duration, TimeSpan?delay, CompositionEasingFunction ease) { element.GetVisual().BeginVector3Animation(propertyPath, to, from, duration, delay, ease); }