public static void ProcessChildren(XamlContext ctx, BamlBlockNode node, BamlElement nodeElem) { ctx.XmlNs.PushScope(nodeElem); if (nodeElem.Xaml.Element != null) nodeElem.Xaml.Element.AddAnnotation(ctx.XmlNs.CurrentScope); foreach (var child in node.Children) { var handler = LookupHandler(child.Type); if (handler == null) { Debug.WriteLine("BAML Handler {0} not implemented.", child.Type); continue; } var elem = handler.Translate(ctx, (BamlNode)child, nodeElem); if (elem != null) { nodeElem.Children.Add(elem); elem.Parent = nodeElem; } ctx.CancellationToken.ThrowIfCancellationRequested(); } ctx.XmlNs.PopScope(); }
public void PushScope(BamlElement element) { CurrentScope = new XmlnsScope(CurrentScope, element); }
public XmlnsScope(XmlnsScope prev, BamlElement elem) { PreviousScope = prev; Element = elem; }