예제 #1
0
        /// <summary>
        /// Evaluates the specified source.
        /// </summary>
        /// <param name="source">The object used as a source for the evaluation.</param>
        /// <param name="binding">The binding.</param>
        /// <returns>The evaluated binding.</returns>
        public static T GetBindingValue(Binding binding, object source)
        {
            var eval = new BindingEvaluator <T>(binding);

            return(eval.GetBindingValue(source));
        }
예제 #2
0
        /// <summary>
        /// Evaluates the specified source.
        /// </summary>
        /// <param name="bindingExpression">The binding.</param>
        /// <returns>The evaluated binding.</returns>
        public static T GetBindingValue(BindingExpression bindingExpression)
        {
            var eval = new BindingEvaluator <T>(bindingExpression.ParentBinding);

            return(eval.GetBindingValue(bindingExpression.DataItem));
        }