internal static Exception BindingSourceNotFound(BindingMemberExpressionNode node)
 {
     return new InvalidOperationException($"The source cannot be found parameter name '{node.ParameterName}', binding member '{node.Path}'");
 }
예제 #2
0
 protected static Func<IDataContext, IObserver> GetBindingSourceDelegate(BindingMemberExpressionNode node)
 {
     IBindingPath path = BindingServiceProvider.BindingPathFactory(node.Path);
     if (node.IsDynamic)
     {
         string resourceName = node.ResourceName;
         return context =>
         {
             var resourceObject = BindingServiceProvider.ResourceResolver.ResolveObject(resourceName, context, true);
             return BindingServiceProvider.ObserverProvider.Observe(resourceObject, path, false, context);
         };
     }
     if (node.IsRelativeSource)
     {
         IRelativeSourceExpressionNode r = node.RelativeSourceExpression;
         return context => BindingExtensions.CreateBindingSource(r, context.GetData(BindingBuilderConstants.Target, true), null);
     }
     return context => BindSource(context, path);
 }
 internal static Exception BindingSourceNotFound(BindingMemberExpressionNode node)
 {
     return
         new InvalidOperationException(
             string.Format("The source cannot be found parameter name '{0}', binding member '{1}'",
                 node.ParameterName, node.Path));
 }