@using Oqtane.Models @using Oqtane.Shared @DynamicComponent @code { [CascadingParameter] protected PageState PageState { get; set; } [Parameter] private Module Module { get; set; } Module ModuleState; string container; RenderFragment DynamicComponent { get; set; } protected override void OnInit() { DynamicComponent = builder => { if (ModuleState != null) { Type containerType = Type.GetType(container); if (containerType != null) { builder.OpenComponent(ModuleState.ModuleId, containerType); // set sequence to moduleid so that component tree is able to differentiate builder.CloseComponent(); } else { // container does not exist with type specified } } }; } protected override Task OnParametersSetAsync() { if (PageState.Page.PageId == Module.PageId) { ModuleState = Module; // passed in from Pane component container = ModuleState.ContainerType; if (PageState.ModuleId != -1 && PageState.Control != "") { container = Constants.DefaultAdminContainer; } } return Task.CompletedTask; } }