Exemplo n.º 1
0
        void Linear6DMotion_AnimationCompleted(object sender, EventArgs e)
        {
            Tuple <TimeSpan, double[], double[]> parameters;

            lock (loc)
            {
                if (queue.Count == 0)
                {
                    wrapper.Finish();
                    return;
                }
                parameters = queue.Dequeue();
            }
            calculator.SetNew(parameters.Item2, parameters.Item3);
            TimeSpan ts = startTime + parameters.Item1 - DateTime.Now;

            if (ts.Ticks < 0)
            {
                return;
            }
            Action action = () =>
            {
                Duration = ts;
                animatable.BeginAnimation(dependencyProperty, this);
            };

            Dispatcher.Invoke(action);
        }