wabbajack/Wabbajack.App.Blazor/Pages/Gallery.razor

36 lines
742 B
Plaintext
Raw Normal View History

2022-01-09 13:33:22 +00:00
@page "/gallery"
@layout Shared.MainLayout
@using Wabbajack.Networking.WabbajackClientApi;
@using System.Linq;
@using Wabbajack.DTOs
@inject Client _client
<div id="content">
@if (_listItems.Count > 0)
2022-01-09 13:33:22 +00:00
{
foreach (ModlistMetadata item in _listItems)
{
<ModlistItem Metadata=@item></ModlistItem>
}
2022-01-09 13:33:22 +00:00
}
</div>
@code {
List<ModlistMetadata> _listItems = new();
2022-01-09 13:33:22 +00:00
protected override async Task OnInitializedAsync()
{
try
{
ModlistMetadata[] modLists = await _client.LoadLists();
_listItems = modLists.ToList();
2022-01-09 13:33:22 +00:00
StateHasChanged();
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
}