CompositionBatchCompletedEventArgs CompositionBatchCompletedEventArgs CompositionBatchCompletedEventArgs CompositionBatchCompletedEventArgs Class

Definition

public : sealed class CompositionBatchCompletedEventArgs : CompositionObject, ICompositionBatchCompletedEventArgspublic sealed class CompositionBatchCompletedEventArgs : CompositionObject, ICompositionBatchCompletedEventArgsPublic NotInheritable Class CompositionBatchCompletedEventArgs Inherits CompositionObject Implements ICompositionBatchCompletedEventArgs// This API is not available in Javascript.
Inheritance
CompositionBatchCompletedEventArgsCompositionBatchCompletedEventArgsCompositionBatchCompletedEventArgsCompositionBatchCompletedEventArgs
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10586.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v2)

Inherited Members

Inherited methods

Inherited properties

Examples


        private void CreateVisuals_Click(object sender, RoutedEventArgs e)
        {
            //Create Scoped batch for animations
            _batch = _compositor.CreateScopedBatch(CompositionBatchTypes.Animation);

            //Setup completion event 
            _batch.Completed += ScopedBatchCompleted;


            //Setup animations
            Animation1(_target);

            _batch.End()
        }

        // Creates and defines the key frame animation 
        private void Animation1(Visual targetVisual)
        {
            var animation1 = _compositor.CreateVector3KeyFrameAnimation();

            animation1.InsertKeyFrame(0.0f, new Vector3(100.00f, 100.00f, 0.00f));
            animation1.InsertKeyFrame(0.5f, new Vector3(300.00f, 100.00f, 0.00f));
            animation1.InsertKeyFrame(1.0f, new Vector3(500.00f, 100.00f, 0.00f));

            animation1.Duration = TimeSpan.FromMilliseconds(2000);
            targetVisual.StartAnimation("Offset", animation1);
        }

        public void ScopedBatchCompleted(object sender, 
            CompositionBatchCompletedEventArgs args)
        {
            _root.Children.Remove(_target);
        }      
    }

See Also