public override void EnsureAnimationCreated() { if (Animation == null) { TargetProperty = ExpressionHelper.ExpressionToPropertyName(expression); var animation = Target.Compositor.CreateExpressionAnimation(); var ce = ExpressionHelper.ExpressionToCompositionExpression(animationexpression); Properties = ce.Parameters; animation.Expression = ce.Expression; ExpressionHelper.ApplyParameters(Animation, ce.Parameters); Animation = animation; } }
public override void EnsureAnimationCreated() { if (Animation == null) { Values = Values.OrderBy(k => k.TimeStamp).ToList(); DistributeKeyFrames(); var ani = createAnimation(Target.Compositor); TargetProperty = ExpressionHelper.ExpressionToPropertyName(expression); if (Values.Count == 1) { Values[0].TimeStamp = 1; } foreach (var item in Values) { insertEasingKey(ani, item.TimeStamp, item.Value, item.Easeing); } ani.Duration = TimeSpan.FromMilliseconds(duration); ani.DelayTime = TimeSpan.FromMilliseconds(delay); if (count > 0) { ani.IterationBehavior = AnimationIterationBehavior.Count; ani.IterationCount = count; } else { ani.IterationBehavior = AnimationIterationBehavior.Forever; } Animation = ani; } }
public TargetedCompositionAnimation(CompositionObject compositionObject, Expression expression, CompositionAnimation animation) { Target = compositionObject; TargetProperty = ExpressionHelper.ExpressionToPropertyName(expression); Animation = animation; }
public R Get <T, R>(T target, Expression <Func <T, R> > expression) => (R)this[ExpressionHelper.ExpressionToPropertyName(expression)];
public TypeAnnotatedCompositionObject <R> Get <R>(Expression <Func <R> > expression) => new TypeAnnotatedCompositionObject <R> { Target = (CompositionObject)this[ExpressionHelper.ExpressionToPropertyName(expression)] };
public static void StopAnimation <T, R>(this T compositionObject, Expression <Func <T, R> > expression) where T : CompositionObject { compositionObject.StopAnimation(ExpressionHelper.ExpressionToPropertyName(expression)); }
public void StopAnimation <R>(Expression <Func <T, R> > expression) { Target.StopAnimation(ExpressionHelper.ExpressionToPropertyName(expression)); }