oqtane.framework/Oqtane.Client/UI/ContainerBuilder.razor
Hisham Bin Ateya 66ad089088
Refactoring (#314)
* Refactoring

* Refactoring

* Check for a valid email.

* Fixed missing character.

* Moved logic to  the Utilities class.

* Rename template .sql file

* Modified null and empty string check.

* Check for a valid email.

* Fixed missing character.

* Moved logic to  the Utilities class.

* Added Favicon support, Progressive Web App support, page title and url support, and private/public user registration options

* Refactoring

* Refactoring

* Check for a valid email.

* Moved logic to  the Utilities class.

Co-authored-by: Aubrey <aubrey.b@treskcow.tech>
Co-authored-by: MIchael Atwood <matwood@dragonmastery.com>
Co-authored-by: Shaun Walker <shaun.walker@siliqon.com>
2020-03-31 10:21:05 -04:00

45 lines
1.3 KiB
Plaintext

@namespace Oqtane.UI
<CascadingValue Value="@_moduleState">
@DynamicComponent
</CascadingValue>
@code {
private Module _moduleState;
[CascadingParameter]
protected PageState PageState { get; set; }
[Parameter]
public Module Module { get; set; }
RenderFragment DynamicComponent { get; set; }
protected override void OnParametersSet()
{
_moduleState = Module; // passed in from Pane component
string container = _moduleState.ContainerType;
if (PageState.ModuleId != -1 && PageState.Action != "" && _moduleState.UseAdminContainer)
{
container = Constants.DefaultAdminContainer;
}
DynamicComponent = builder =>
{
Type containerType = Type.GetType(container);
if (containerType != null)
{
builder.OpenComponent(0, containerType);
builder.CloseComponent();
}
else
{
// container does not exist with type specified
builder.OpenComponent(0, Type.GetType(Constants.ModuleMessageComponent));
builder.AddAttribute(1, "Message", "Error Loading Module Container " + container);
builder.CloseComponent();
}
};
}
}