
Security News
New CNA Scorecard Tool Ranks CVE Data Quality Across the Ecosystem
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Drag and drop component for Blazor
Install-Package BlazorQ.DropZone
services.AddBlazorDragDrop();
@using BlazorQ.DragDrop
You have to create a dropzone and assign your items to it:
<DropZone Items="MyTasks">
<div>@context.Name</div>
</DropZone>
A single DropZone makes sense, because the default value of CanReorder is true. So you can drag & drop items inside the only zone.
Usually you have at least two DropZones with items of the same or different type.
You can drag & drop items among DropZones with items of the same type, in other cases you need to specify Accepts like in the following example:
<DropZone Items="Cats" ItemWrapperClass="@((item) => "cat")" Accepts="NewCat" OnItemDrop="SaveCatsOrder">
<div>@context.Name</div>
<img src="@($"api/data/photos?fileName={context.Photo}")" style="margin: 10px; width: 100px;" />
</DropZone>
<DropZone Items="Dogs" ItemWrapperClass="@((item) => "dog")" Accepts="NewDog">
<div>@context.Name</div>
<img src="@($"api/data/photos?fileName={context.Photo}")" style="margin: 10px; width: 100px;" />
</DropZone>
<DropZone Items="Photos" Context="fileName" CanReorder="false" Accepts="RestorePhoto">
<img src="@($"api/data/photos?fileName={fileName}")" style="margin: 10px; width: 100px;" />
</DropZone>
@code {
private Cat NewCat(object source, object target)
{
if (source is string fileName)
return new Cat()
{
Id = Guid.NewGuid(),
Photo = fileName
};
else
return null;
}
private Dog NewDog(object source, object target)
{
if (source is string fileName)
return new Dog()
{
Id = Guid.NewGuid(),
Photo = fileName
};
else
return null;
}
private string RestorePhoto(object source, object target)
{
if (source is Cat)
return ((Cat)source).Photo
else if (source is Dog)
return ((Dog)source).Photo
return null;
}
private void SaveCatsOrder(DragDropArgs<Cat> args)
{
int i = 0;
foreach (var item in Cats)
item.Order = ++i;
}
}
FAQs
Drag and drop component for Blazor
We found that blazorq.dropzone demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.