public Context(
     XamlElementNameProvider xamlElementNameProvider,
     List <XamlModificationInfo> xamlModificationInfos            = null,
     Dictionary <BindingRootNode, QualifiedType> bindingRootTypes = null,
     XamlModificationTracker xamlModificationTracker = null)
 {
     this.XamlElementNameProvider = xamlElementNameProvider;
     this.XamlModificationInfos   = xamlModificationInfos ?? new List <XamlModificationInfo>();
     this.BindingRootTypes        = bindingRootTypes ?? new Dictionary <BindingRootNode, QualifiedType>();
     this.XamlModificationTracker = xamlModificationTracker;
 }
        public bool BindingRoot(BindingRootNode bindingRootNode, Parameters parameters, Context context)
        {
            if (bindingRootNode.Name != null)
            {
                var xamlModificationTracker = new XamlModificationTracker {
                    ModificationsRootElement = bindingRootNode.XElement
                };
                if (this.VisitChildBindings(bindingRootNode.Bindings, parameters, new Context(xamlModificationTracker, context)))
                {
                    var bindingContainerType = new QualifiedType(QualifiedType.GlobalAlias, parameters.AssemblyName, parameters.Namespace, bindingRootNode.Name + BindingContainer);
                    context.BindingRootTypes.Add(bindingRootNode, bindingContainerType);
                    context.XamlModificationInfos.Add(new XamlModificationInfo(bindingContainerType, xamlModificationTracker.ModificationsRootElement, xamlModificationTracker.XamlModifications));
                    context.XamlElementNameProvider.Reset();
                    return(true);
                }
            }

            context.XamlElementNameProvider.Reset();
            return(false);
        }
 public Context(XamlModificationTracker xamlModificationTracker, Context context)
     : this(context.XamlElementNameProvider, context.XamlModificationInfos, context.BindingRootTypes, xamlModificationTracker)
 {
 }