You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
789 B
32 lines
789 B
using BlazorApp1.Components;
|
|
using BlazorApp1.Models;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace BlazorApp1.Pages
|
|
{
|
|
public partial class Index
|
|
{
|
|
[Inject]
|
|
public IDataService DataService { get; set; }
|
|
|
|
public List<Item> Items { get; set; } = new List<Item>();
|
|
|
|
private List<CraftingRecipe> Recipes { get; set; } = new List<CraftingRecipe>();
|
|
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
{
|
|
base.OnAfterRenderAsync(firstRender);
|
|
|
|
if (!firstRender)
|
|
{
|
|
return;
|
|
}
|
|
|
|
Items = await DataService.List(0, await DataService.Count());
|
|
Recipes = await DataService.GetRecipes();
|
|
|
|
StateHasChanged();
|
|
}
|
|
}
|
|
}
|