public void Activate(IFubuPage page) { page.ServiceLocator = _services; page.As <IFubuPage <T> >().Model = findModel(); if (_view.ProfileName.IsNotEmpty()) { page.Get <ActiveProfile>().Push(_view.ProfileName); } }
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(); }