|
|
@ -1,19 +1,9 @@
|
|
|
|
using BlazorAppClean.Models;
|
|
|
|
using BlazorAppClean.Models;
|
|
|
|
using Blazorise.DataGrid;
|
|
|
|
using BlazorAppClean.Services;
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
using Microsoft.JSInterop;
|
|
|
|
using Microsoft.JSInterop;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.Collections.Specialized;
|
|
|
|
using System.Collections.Specialized;
|
|
|
|
using BlazorAppClean.Modals;
|
|
|
|
|
|
|
|
using BlazorAppClean.Models;
|
|
|
|
|
|
|
|
using BlazorAppClean.Services;
|
|
|
|
|
|
|
|
using Blazored.LocalStorage;
|
|
|
|
|
|
|
|
using Blazored.Modal;
|
|
|
|
|
|
|
|
using Blazored.Modal.Services;
|
|
|
|
|
|
|
|
using Blazorise.DataGrid;
|
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
|
|
|
using Microsoft.Extensions.Localization;
|
|
|
|
|
|
|
|
using Blazorise;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace BlazorAppClean.Components
|
|
|
|
namespace BlazorAppClean.Components
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -23,7 +13,24 @@ namespace BlazorAppClean.Components
|
|
|
|
public IDataService DataService { get; set; }
|
|
|
|
public IDataService DataService { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
private int totalItem;
|
|
|
|
private int totalItem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Item CurrentDragItem { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[CascadingParameter]
|
|
|
|
|
|
|
|
public InventoryComponent Parent { get; set; }
|
|
|
|
|
|
|
|
public List<Item> RecipeItems { get; set; }
|
|
|
|
public List<Item> Items { get; set; } = new List<Item>();
|
|
|
|
public List<Item> Items { get; set; } = new List<Item>();
|
|
|
|
|
|
|
|
public ObservableCollection<InventoryAction> Actions { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
|
|
|
internal IJSRuntime JavaScriptRuntime { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public InventoryComponent()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Actions = new ObservableCollection<InventoryAction>();
|
|
|
|
|
|
|
|
Actions.CollectionChanged += OnActionsCollectionChanged;
|
|
|
|
|
|
|
|
this.RecipeItems = new List<Item> { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -39,6 +46,10 @@ namespace BlazorAppClean.Components
|
|
|
|
|
|
|
|
|
|
|
|
StateHasChanged();
|
|
|
|
StateHasChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void OnActionsCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
JavaScriptRuntime.InvokeVoidAsync("Crafting.AddActions", e.NewItems);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|