@page "/"
<h1>Hello, world!</h1>
Welcome to your new app.
<div style="height: 300px;width: 300px;background-color: cornflowerblue;touch-action: none; border: medium;"
ondragover="event.preventDefault();"
@ontouchcancel="OnTouch"
@ontouchend="OnTouch"
@ontouchenter="OnTouch"
@ontouchleave="OnTouch"
@ontouchmove="OnTouch"
@ontouchstart="OnTouch"
@ondrag="OnDrag"
@ondragstart="OnDrag"
@ondragend="OnDrag"
@ondragenter="OnDrag"
@ondragleave="OnDrag"
@ondrop="OnDrop">
Drag to Me
</div>
<DragItem></DragItem>
<DragItem></DragItem>
<DragItem></DragItem>
<DragItem></DragItem>
@code{
private void OnTouch(TouchEventArgs args)
{
Console.WriteLine("Index:OnTouch:" + args.Type);
}
void OnDrag(DragEventArgs args)
{
Console.WriteLine("Index:OnDrag:" + args.Type);
}
void OnDrop(DragEventArgs args)
{
Console.WriteLine("Index:OnDrop:" + args.Type);
}
}