コード例 #1
0
 public static void Verify(XamlContextBase ctx, IXamlAstNode node)
 {
     if (ctx.TryGetItem <XamlNeedsParentStackCache>(out var cache) && !cache.ContainsKey(node))
     {
         throw new XamlLoadException("Node needs parent stack, but one doesn't seem to be provided", node);
     }
 }
コード例 #2
0
        public static void Verify(XamlContextBase ctx, IXamlAstNode node)
        {
            var cache = ctx.GetItem <XamlNeedsParentStackCache>();

            // There is no parent stack
            if (cache == null)
            {
                return;
            }
            if (!cache.ContainsKey(node))
            {
                throw new XamlLoadException("Node needs parent stack, but one doesn't seem to be provided", node);
            }
        }