Ejemplo n.º 1
0
        // 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);
        }
Ejemplo n.º 2
0
 public WidgetRenderer(WidgetRenderContext renderContext)
 {
     _renderContext = renderContext;
 }