@using Oqtane.Shared @using Oqtane.Modules @DynamicComponent @code { [CascadingParameter] PageState PageState { get; set; } RenderFragment DynamicComponent { get; set; } protected override void OnInit() { DynamicComponent = builder => { Type themeType = Type.GetType(PageState.Page.ThemeType); if (themeType != null) { builder.OpenComponent(0, themeType); builder.CloseComponent(); } else { // theme does not exist with type specified builder.OpenComponent(0, Type.GetType(Constants.ModuleMessageControl)); builder.AddAttribute(1, "Type", MessageType.Error); builder.AddAttribute(2, "Message", "Error Loading Page Theme " + PageState.Page.ThemeType); builder.CloseComponent(); } }; } }