Пример #1
0
        public void RegisterRenderer(UIElement element, ElementRenderer renderer)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element));
            }
            if (renderer == null)
            {
                throw new ArgumentNullException(nameof(renderer));
            }

            elementIdToRenderer[element.Id] = renderer;
        }
Пример #2
0
 public DefaultRenderersFactory(IServiceRegistry services)
 {
     defaultRenderer = new ElementRenderer(services);
     typeToRenderers[typeof(Border)]           = new DefaultBorderRenderer(services);
     typeToRenderers[typeof(Button)]           = new DefaultButtonRenderer(services);
     typeToRenderers[typeof(ContentDecorator)] = new DefaultContentDecoratorRenderer(services);
     typeToRenderers[typeof(EditText)]         = new DefaultEditTextRenderer(services);
     typeToRenderers[typeof(ImageElement)]     = new DefaultImageRenderer(services);
     typeToRenderers[typeof(ModalElement)]     = new DefaultModalElementRenderer(services);
     typeToRenderers[typeof(ScrollBar)]        = new DefaultScrollBarRenderer(services);
     typeToRenderers[typeof(ScrollingText)]    = new DefaultScrollingTextRenderer(services);
     typeToRenderers[typeof(Slider)]           = new DefaultSliderRenderer(services);
     typeToRenderers[typeof(TextBlock)]        = new DefaultTextBlockRenderer(services);
     typeToRenderers[typeof(ToggleButton)]     = new DefaultToggleButtonRenderer(services);
 }