Initial commit
This commit is contained in:
26
Oqtane.Client/Shared/Skin.razor
Normal file
26
Oqtane.Client/Shared/Skin.razor
Normal file
@ -0,0 +1,26 @@
|
||||
@using Oqtane.Shared
|
||||
|
||||
@DynamicComponent
|
||||
|
||||
@functions {
|
||||
[CascadingParameter] PageState PageState { get; set; }
|
||||
|
||||
RenderFragment DynamicComponent { get; set; }
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
DynamicComponent = builder =>
|
||||
{
|
||||
Type skinType = Type.GetType(PageState.Page.SkinType);
|
||||
if (skinType != null)
|
||||
{
|
||||
builder.OpenComponent(0, skinType);
|
||||
builder.CloseComponent();
|
||||
}
|
||||
else
|
||||
{
|
||||
// skin does not exist with type specified
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user