@layout PageLayout @inject INoteService noteService @implements IDisposable @page "/notes" @if (!noteService.IsLoaded()) { } else { @foreach (var noteSection in noteService.NoteSectionModels) { @noteSection.Name @foreach (var noteContent in noteSection.NoteContentModels) { @noteContent.Name @noteContent.Description } } } @code { [Parameter] public string? Href1 { get; set; } [Parameter] public string? Href2 { get; set; } [Parameter] public string? Href3 { get; set; } [Parameter] public string? Href4 { get; set; } [Parameter] public string? Href5 { get; set; } private string Href => Href5 ?? Href4 ?? Href3 ?? Href2 ?? Href1 ?? ""; string selectedSection = "All"; protected override void OnInitialized() { noteService.Subscribe(StateHasChanged); noteService.Load(); } void IDisposable.Dispose() { noteService.Unsubscribe(StateHasChanged); } void OnSectionChanged(ChangeEventArgs e) { selectedSection = e.Value!.ToString()!; StateHasChanged(); } }