コード例 #1
0
        internal CompositionScopedBatch StartAnimations(AnimationCollection target)
        {
            lock (Locker)
            {
                Compositor compositor = target?.FirstOrDefault()?.TargetVisual?.Compositor;

                if (compositor == null)
                {
                    return(null);
                }

                CompositionScopedBatch resultBatch = compositor.CreateScopedBatch(CompositionBatchTypes.Animation);

                foreach (var animation in target)
                {
                    animation.TargetVisual.StartAnimation(animation.TargetProperty.ToString(), animation.BuildCompositionAnimation());
                }

                resultBatch.End();

                return(resultBatch);
            }
        }