37 lines
938 B
Plaintext
37 lines
938 B
Plaintext
@namespace Oqtane.Themes.Controls
|
|
|
|
@if (_menuType != null)
|
|
{
|
|
<DynamicComponent Type="@_menuType" Parameters="@Attributes"></DynamicComponent>
|
|
}
|
|
|
|
@code{
|
|
[Parameter]
|
|
public string Orientation { get; set; }
|
|
|
|
[Parameter]
|
|
public string MenuType { get; set; }
|
|
|
|
[Parameter(CaptureUnmatchedValues = true)]
|
|
public Dictionary<string, object> Attributes { get; set; } = new Dictionary<string, object>();
|
|
|
|
private Type _menuType;
|
|
|
|
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";
|
|
}
|
|
}
|
|
|
|
_menuType = Type.GetType(MenuType);
|
|
}
|
|
}
|