@using System.Collections.ObjectModel Manage space
@Children.Count children @if (_shouldRenderChildren) {

Breadcrumb: @Breadcrumbs

}
@code { [Parameter] public RoomInfo Space { get; set; } [Parameter, CascadingParameter] public List KnownRooms { get; set; } = new(); [Parameter, CascadingParameter] public string? Breadcrumbs { get => _breadcrumbs + Space.Room.RoomId; set => _breadcrumbs = value; } private ObservableCollection Children { get; set; } = new(); protected override async Task OnInitializedAsync() { if (Breadcrumbs == null) throw new ArgumentNullException(nameof(Breadcrumbs)); await Task.Delay(Random.Shared.Next(1000, 10000)); var rooms = Space.Room.AsSpace.GetChildrenAsync(); await foreach (var room in rooms) { if (Breadcrumbs.Contains(room.RoomId)) continue; var roomInfo = KnownRooms.FirstOrDefault(x => x.Room.RoomId == room.RoomId); if (roomInfo is null) { roomInfo = new RoomInfo() { Room = room }; KnownRooms.Add(roomInfo); } Children.Add(roomInfo); } await base.OnInitializedAsync(); } private bool _shouldRenderChildren = false; private string? _breadcrumbs; private Task SpaceChildrenOpened() { if (_shouldRenderChildren) return Task.CompletedTask; _shouldRenderChildren = true; Console.WriteLine($"[RoomList] Rendering children of {Space.Room.RoomId}"); return Task.CompletedTask; } }