/// <summary>
        /// Sets the Expression property of ExpressionAnimation by converting
        /// the given Expression to appropriate string
        /// </summary>
        /// <typeparam name="T">Type of the Expression</typeparam>
        /// <param name="animation">ExpressionAnimation</param>
        /// <param name="expression">Expression</param>
        /// <returns>Dictionary of parameter names and the parameters</returns>
        public static Dictionary <string, object> SetExpression <T>(this ExpressionAnimation animation,
                                                                    Expression <CompositionLambda <T> > expression)
        {
            var result = CompositionExpressionEngine.CreateCompositionExpression(expression);

            animation.Expression = result.Expression;
            animation.SetParameters(result.Parameters);

            return(result.Parameters);
        }