Example #1
0
        public static IVisualElementRenderer CreateRenderer(VisualElement element, IVisualElementRenderer parent)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element));
            }

            IVisualElementRenderer renderer = parent?.CreateChildRenderer(element);

            if (renderer == null)
            {
                renderer = Registrar.Registered.GetHandlerForObject <IVisualElementRenderer>(element) ?? new DefaultRenderer();
            }
            renderer.SetElement(element);
            return(renderer);
        }
Example #2
0
        public static IVisualElementRenderer CreateRenderer(VisualElement element, IVisualElementRenderer parent)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element));
            }

            IVisualElementRenderer renderer = parent?.CreateChildRenderer(element);

            if (renderer == null)
            {
                // a page is not a view

                /* if (element is Page)
                 *   renderer = new PageRenderer<Page, Control>();
                 * else*/
                renderer = Registrar.Registered.GetHandlerForObject <IVisualElementRenderer>(element) ??
                           new DefaultRenderer();
            }
            renderer.SetElement(element);
            return(renderer);
        }