oqtane.framework/Oqtane.Client/Shared/Theme.razor
2019-06-19 08:32:04 -04:00

27 lines
605 B
Plaintext

@using Oqtane.Shared
@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
}
};
}
}