Files
oqtane.framework/Oqtane.Client/Themes/Controls/Theme/Menu.razor
2025-12-19 15:35:35 -05:00

34 lines
794 B
Plaintext

@namespace Oqtane.Themes.Controls
@if (ComponentType != null)
{
<DynamicComponent Type="@ComponentType"></DynamicComponent>
}
@code{
[Parameter]
public string Orientation { get; set; }
[Parameter]
public string MenuType { get; set; }
public Type ComponentType { get; set; }
protected override void OnInitialized()
{
if (string.IsNullOrEmpty(MenuType) && !string.IsNullOrEmpty(Orientation))
{
if (Orientation == "Horizontal")
{
MenuType = "Oqtane.Themes.Controls.MenuHorizontal, Oqtane.Client";
}
else
{
MenuType = "Oqtane.Themes.Controls.MenuVertical, Oqtane.Client";
}
}
ComponentType = Type.GetType(MenuType);
}
}