public void RegisterRendererFactory(Type uiElementType, IElementRendererFactory factory) { if (uiElementType == null) throw new ArgumentNullException(nameof(uiElementType)); if (factory == null) throw new ArgumentNullException(nameof(factory)); if(!typeof(UIElement).GetTypeInfo().IsAssignableFrom(uiElementType.GetTypeInfo())) throw new InvalidOperationException(uiElementType + " is not a descendant of UIElement."); typesToUserFactories[uiElementType] = factory; }
public void RegisterRendererFactory(Type uiElementType, IElementRendererFactory factory) { if (uiElementType == null) { throw new ArgumentNullException(nameof(uiElementType)); } if (factory == null) { throw new ArgumentNullException(nameof(factory)); } if (!typeof(UIElement).GetTypeInfo().IsAssignableFrom(uiElementType.GetTypeInfo())) { throw new InvalidOperationException(uiElementType + " is not a descendant of UIElement."); } typesToUserFactories[uiElementType] = factory; }
public void RegisterRendererFactory(Type uiElementType, IElementRendererFactory factory) { rendererManager.RegisterRendererFactory(uiElementType, factory); }
/// <summary> /// Create a new instance of <see cref="RendererManager"/> with provided DefaultFactory /// </summary> /// <param name="defaultFactory"></param> public RendererManager(IElementRendererFactory defaultFactory) { this.defaultFactory = defaultFactory; }