public static void ActivateView(IViewActivator activator, IFubuView view) { var closedInterface = view.GetType().FindInterfaceThatCloses(typeof(IFubuPage <>)); if (closedInterface != null) { var parameterType = closedInterface.GetGenericArguments().First(); var activatorType = typeof(TemplatedActivator <>).MakeGenericType(parameterType); var specificActivator = (IActivator)Activator.CreateInstance(activatorType); specificActivator.Activate(activator, view); } var page = view as IFubuPage; if (page == null) { return; } activator.Activate(page); }
public void Activate(IViewActivator activator, IFubuView view) { activator.Activate((IFubuPage <T>)view); }