Merge pull request #5435 from sbwalker/dev

fix #5364 - add ability to specify preferred Container per Pane
This commit is contained in:
Shaun Walker
2025-07-30 10:43:51 -04:00
committed by GitHub
2 changed files with 11 additions and 0 deletions

View File

@ -31,6 +31,9 @@
[Parameter]
public Module ModuleState { get; set; }
[Parameter]
public string ContainerType { get; set; }
protected override bool ShouldRender()
{
return PageState?.RenderId == ModuleState?.RenderId;
@ -44,6 +47,10 @@
protected override void OnParametersSet()
{
string container = ModuleState.ContainerType;
if (!string.IsNullOrEmpty(ContainerType))
{
container = ContainerType;
}
if (PageState.ModuleId != -1 && PageState.Route.Action != "" && ModuleState.UseAdminContainer)
{
container = (!string.IsNullOrEmpty(PageState.Site.AdminContainerType)) ? PageState.Site.AdminContainerType : Constants.DefaultAdminContainer;

View File

@ -26,6 +26,9 @@ else
[Parameter]
public string Name { get; set; }
[Parameter]
public string ContainerType { get; set; }
RenderFragment DynamicComponent { get; set; }
protected override void OnParametersSet()
@ -119,6 +122,7 @@ else
{
builder.OpenComponent(0, typeof(ContainerBuilder));
builder.AddAttribute(1, "ModuleState", module);
builder.AddAttribute(2, "ContainerType", ContainerType);
builder.SetKey(module.PageModuleId);
builder.CloseComponent();
}