fix #5364 - add ability to specify preferred Container per Pane
This commit is contained in:
@ -31,6 +31,9 @@
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public Module ModuleState { get; set; }
|
public Module ModuleState { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string ContainerType { get; set; }
|
||||||
|
|
||||||
protected override bool ShouldRender()
|
protected override bool ShouldRender()
|
||||||
{
|
{
|
||||||
return PageState?.RenderId == ModuleState?.RenderId;
|
return PageState?.RenderId == ModuleState?.RenderId;
|
||||||
@ -44,6 +47,10 @@
|
|||||||
protected override void OnParametersSet()
|
protected override void OnParametersSet()
|
||||||
{
|
{
|
||||||
string container = ModuleState.ContainerType;
|
string container = ModuleState.ContainerType;
|
||||||
|
if (!string.IsNullOrEmpty(ContainerType))
|
||||||
|
{
|
||||||
|
container = ContainerType;
|
||||||
|
}
|
||||||
if (PageState.ModuleId != -1 && PageState.Route.Action != "" && ModuleState.UseAdminContainer)
|
if (PageState.ModuleId != -1 && PageState.Route.Action != "" && ModuleState.UseAdminContainer)
|
||||||
{
|
{
|
||||||
container = (!string.IsNullOrEmpty(PageState.Site.AdminContainerType)) ? PageState.Site.AdminContainerType : Constants.DefaultAdminContainer;
|
container = (!string.IsNullOrEmpty(PageState.Site.AdminContainerType)) ? PageState.Site.AdminContainerType : Constants.DefaultAdminContainer;
|
||||||
|
@ -26,6 +26,9 @@ else
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string ContainerType { get; set; }
|
||||||
|
|
||||||
RenderFragment DynamicComponent { get; set; }
|
RenderFragment DynamicComponent { get; set; }
|
||||||
|
|
||||||
protected override void OnParametersSet()
|
protected override void OnParametersSet()
|
||||||
@ -119,6 +122,7 @@ else
|
|||||||
{
|
{
|
||||||
builder.OpenComponent(0, typeof(ContainerBuilder));
|
builder.OpenComponent(0, typeof(ContainerBuilder));
|
||||||
builder.AddAttribute(1, "ModuleState", module);
|
builder.AddAttribute(1, "ModuleState", module);
|
||||||
|
builder.AddAttribute(2, "ContainerType", ContainerType);
|
||||||
builder.SetKey(module.PageModuleId);
|
builder.SetKey(module.PageModuleId);
|
||||||
builder.CloseComponent();
|
builder.CloseComponent();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user