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.

73 lines
1.4 KiB

using Microsoft.AspNetCore.Components;
namespace BlazorApp1.Components
{
public partial class ListItem :ItemDisplay
{
[Parameter]
public int Index { get; set; }
[Parameter]
public Item Item { get; set; }
[Parameter]
public bool NoDrop { get; set; }
[CascadingParameter]
public Inventory Parent { get; set; }
public void changeState()
{
StateHasChanged();
}
public Item getItem()
{
return Item;
}
public int getNbElement()
{
return 1;
}
public String getTypeID()
{
return "ListItem";
}
internal void OnDragEnter()
{
if (NoDrop)
{
return;
}
}
internal void OnDragLeave()
{
if (NoDrop)
{
return;
}
}
internal void OnDrop()
{
if (NoDrop)
{
return;
}
this.Item = Parent.CurrentDragItem;
}
private void OnDragStart()
{
Parent.CurrentDragItem = this.Item;
Parent.CurrentEllement = this;
}
}
}