Пример #1
0
        public void Activate(IFubuPage page)
        {
            page.ServiceLocator = _services;
            page.As <IFubuPage <T> >().Model = findModel();

            if (_view.ProfileName.IsNotEmpty())
            {
                page.Get <ActiveProfile>().Push(_view.ProfileName);
            }
        }
Пример #2
0
        public void Render <T>(IFubuPage view, T viewModel, string prefix, TextWriter writer, int?index = null) where T : class
        {
            var page = new Page();

            page.Controls.Add(view as Control);

            view.As <IFubuPage <T> >().Model = viewModel;

            setParentPageIfNotAlreadySet(view, page);

            if (index.HasValue)
            {
                prefix = "{0}[{1}]".ToFormat(prefix, index);
            }

            view.ElementPrefix = prefix;

            _builder.ExecuteControl(page, writer);

            writer.Flush();
        }