public void EndUpdate() { IAttachViewRoot attachedViewRoot; this.IsDelaying = false; List <CrossDocumentUpdateContext.ContextInfo> contextInfos = this.contexts; this.contexts = null; for (int i = contextInfos.Count - 1; i >= 0; i--) { CrossDocumentUpdateContext.ContextInfo item = contextInfos[i]; if (item.DelayedNodes != null) { item.Context.ViewNodeManager.UpdateDelayedNodes(item.DelayedNodes); } } for (int j = contextInfos.Count - 1; j >= 0; j--) { CrossDocumentUpdateContext.ContextInfo contextInfo = contextInfos[j]; InstanceBuilderContextBase context = contextInfo.Context as InstanceBuilderContextBase; if (context != null) { attachedViewRoot = context.AttachedViewRoot; } else { attachedViewRoot = null; } contextInfo.Context.ViewNodeManager.UpdateReferences(attachedViewRoot, false); } }
private CrossDocumentUpdateContext.ContextInfo GetContextInfo(IInstanceBuilderContext context, bool createIfMissing) { CrossDocumentUpdateContext.ContextInfo contextInfo = this.contexts.Find((CrossDocumentUpdateContext.ContextInfo info) => info.Context == context); if (contextInfo == null && createIfMissing) { contextInfo = new CrossDocumentUpdateContext.ContextInfo(context); this.contexts.Add(contextInfo); } return(contextInfo); }
public void OnViewNodeRemoving(IInstanceBuilderContext context, ViewNode viewNode) { if (this.contexts != null) { CrossDocumentUpdateContext.ContextInfo contextInfo = this.GetContextInfo(context, false); if (contextInfo != null && contextInfo.DelayedNodes != null) { contextInfo.DelayedNodes.Remove(viewNode); } } }