From 47ac1c1d25db111d837d456e554437fe28792bdc Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 27 Sep 2023 16:19:32 +0200 Subject: [PATCH] =?UTF-8?q?Completato=20men=C3=B9=20da=20DB=20(primo=20liv?= =?UTF-8?q?ello)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MP-TAB.Client/Components/SlideMenu.razor | 22 ++------ MP-TAB/MP-TAB/Components/Layout/NavMenu.razor | 55 ++++++++++++++++--- 2 files changed, 52 insertions(+), 25 deletions(-) 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(); + } +}