timelapse/Timelapse/Pages/ExtensionWindow.razor

26 lines
653 B
Plaintext

@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);
}
}