// GET: /<controller>/ public IActionResult Index() { var descriptor = _widgetHarvester.HarvestWidgets().Last(); var renderer = _lifetimeScope.ResolveNamed<Lazy<IRenderer>>(descriptor.RendererDescriptor.RendererName,new PositionalParameter(0, descriptor.RendererDescriptor.Model)); var context = new WidgetRenderContext(renderer,"Page1", "page", "Widget1", descriptor.Name, new Dictionary<string, object>()); var widgetRenderer = _lifetimeScope.Resolve<Lazy<IWidgetRenderer>>(new PositionalParameter(0, context)); var page = new Page(() => _pageRenderEventses.Value) { Widgets = new IWidget[] { new Widget(descriptor,widgetRenderer) } }; return View(page); }
public WidgetRenderer(WidgetRenderContext renderContext) { _renderContext = renderContext; }