|
|
|
@ -1,6 +1,32 @@
|
|
|
|
|
namespace CetteAppliVaMarcher.Pages
|
|
|
|
|
using CetteAppliVaMarcher.Components;
|
|
|
|
|
using CetteAppliVaMarcher.Models;
|
|
|
|
|
using CetteAppliVaMarcher.Services;
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
|
|
|
|
|
namespace CetteAppliVaMarcher.Pages
|
|
|
|
|
{
|
|
|
|
|
public partial class Inventory
|
|
|
|
|
{
|
|
|
|
|
[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();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|