/// <summary> /// Get page provider. /// </summary> /// <param name="module"></param> /// <param name="host"></param> /// <returns></returns> public static IPageProvider?GetPageProvider(this IRazorComponentClientModule module, IModuleHost host) { var collection = host.GetRazorComponentClientModuleCollection(); var manifest = collection.GetManifest(module.GetType()); if (manifest.PageProvider is not null) { return((IPageProvider)host.Services.GetRequiredService(manifest.PageProvider)); } return(null); }
/// <summary> /// Create the instance. /// </summary> /// <param name="host"></param> protected RazorComponentClientModule(IModuleHost host) : base(host) { Collection = host.GetRazorComponentClientModuleCollection(); _manifest = new Lazy <RazorComponentClientModuleManifest>(() => Collection.GetManifest(GetType())); }