diff --git a/MP-TAB/MP-TAB.Client/Components/SlideMenu.razor b/MP-TAB/MP-TAB.Client/Components/SlideMenu.razor index 68095247..14b5b2ce 100644 --- a/MP-TAB/MP-TAB.Client/Components/SlideMenu.razor +++ b/MP-TAB/MP-TAB.Client/Components/SlideMenu.razor @@ -25,22 +25,12 @@
-
- @* - - <%# Eval("Testo") %> - - - - - - - *@ + + @foreach (var item in MenuItems) + { + @item.Testo + }
@@ -52,5 +42,5 @@ @code { [Parameter] - public List MenuItems { get; set; } = null!; + public List MenuItems { get; set; } = new List(); } diff --git a/MP-TAB/MP-TAB/Components/Layout/NavMenu.razor b/MP-TAB/MP-TAB/Components/Layout/NavMenu.razor index 2708b49d..0dc01b01 100644 --- a/MP-TAB/MP-TAB/Components/Layout/NavMenu.razor +++ b/MP-TAB/MP-TAB/Components/Layout/NavMenu.razor @@ -1,7 +1,10 @@ - -
+@inject MenuData MDataService + + +@*
*@ +
- +
@@ -18,17 +21,26 @@ + +@code{ + + /// + /// Elenco items da menù per pagina corrente... + /// + protected List CurrMenuItems { get; set; } = new List(); + + /// + /// Livello corrente del menu + /// + protected string CurrLevel = "T2H"; + + /// + /// Init struttura dati + /// + /// + protected override async Task OnInitializedAsync() + { + await Task.Delay(1); + CurrMenuItems = await MDataService.ListLinkFilt(CurrLevel); + // return base.OnInitializedAsync(); + } +}