pour aurian sous la menace
continuous-integration/drone/push Build is passing Details

master
remrem 2 years ago
parent 6e754626cb
commit 9cb1d36242

@ -20,4 +20,7 @@
<div class="actions" id="actions">
</div>
</div>
</CascadingValue>
<InventoryList/>
</CascadingValue>

@ -3,7 +3,8 @@ using Blazor.Pages;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
namespace Blazor.Components
{
partial class Inventory
@ -17,7 +18,8 @@ namespace Blazor.Components
public Inventory()
{
Actions = new ObservableCollection<InventoryAction>();
Actions = new ObservableCollection<InventoryAction>();
Actions.CollectionChanged += OnActionsCollectionChanged;
}
public void update()
{
@ -25,6 +27,9 @@ namespace Blazor.Components
return;
}
private void OnActionsCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
{
JavaScriptRuntime.InvokeVoidAsync("Crafting.AddActions", e.NewItems);
}
}
}

@ -5,8 +5,6 @@
width: 40%;
}
.actions {
border: 1px solid black;
height: 250px;

@ -11,7 +11,7 @@
<DataGridColumn TItem="Item" Field="@nameof(Item.Id)" Caption="#" Width="15%"/>
<DataGridColumn TItem="Item" Field="@nameof(Item.Id)" Caption="Image" Filterable="false">
<DisplayTemplate>
<InventoryListImage Item="context" />
<InventoryListImage Item="context"/>
</DisplayTemplate>
</DataGridColumn>
<DataGridColumn TItem="Item" Field="@nameof(Item.DisplayName)" Caption="Display name">

Loading…
Cancel
Save