public static TWizardPage AddPage <TWizardPage>(this IWizard wizard) where TWizardPage : IWizardPage { Argument.IsNotNull(() => wizard); var typeFactory = wizard.GetTypeFactory(); var page = typeFactory.CreateInstance <TWizardPage>(); wizard.AddPage(page); return(page); }