public bool ElementBindingSource( ElementBindingSourceNode elementBindingSourceNode, Parameters parameters, Context context) { var elementName = context.XamlElementNameProvider.GetName(elementBindingSourceNode); var elementType = parameters.XamlTypeResolver.Parse(elementBindingSourceNode.TargetElement.Name); var bindingSource = context.BindingSourceProvider.AddElement(elementType, elementName); var sourceVariableName = bindingSource.Name; var newContext = new Context(new StringBuilder(), bindingSource, context); if (this.VisitChildBindings(elementBindingSourceNode.Bindings, parameters, newContext)) { context.ExternAliases.TryAdd(elementType); context.BindingContainerSourceCodeBuilder.AppendLine($" var {sourceVariableName} = this.GetElementContext({TargetCodeGenerator.GetTargetLambda(elementType, elementName, context.HasCodeBehind)});"); context.BindingContainerSourceCodeBuilder.Append(newContext.BindingContainerSourceCodeBuilder); return(true); } return(false); }
public void ElementBindingSource(ElementBindingSourceNode elementBindingSourceNode, StringBuilder stringBuilder, int indent) { PrivateVisit(stringBuilder, indent, elementBindingSourceNode, elementBindingSourceNode.Bindings); }
public bool ElementBindingSource(ElementBindingSourceNode elementBindingSourceNode, Parameters parameters, Context context) { return(this.VisitChildBindings(elementBindingSourceNode.Bindings, parameters, context)); }