timelapse/Timelapse/Pages/ExtensionWindow.razor

26 lines
653 B
Plaintext
Raw Permalink Normal View History

2021-12-30 04:07:55 +00:00
@page "/ExtensionPage/{Extension}/{PageName}"
@using Timelapse.Api;
@inject NavigationManager Nav;
@dynamicComponent()
@functions{
RenderFragment dynamicComponent() => builder =>
{
builder.OpenComponent(0, FindType());
builder.CloseComponent();
};
[Parameter]
public string Extension {get;set;}
[Parameter]
public string PageName {get;set;}
Type FindType()
{
string url = $"/ExtensionPage/{Extension}/{PageName}";
if(Timelapse.Api.Extensions.Components.ContainsKey(url))
{
return Timelapse.Api.Extensions.Components[url];
}
return typeof(NoneFound);
}
}