Skip to content

DropZone.Dropped

event · DropZone · cAlgo.API Since 5.1

DesktopCLICloud

Occurs when files are dropped.

Environment behaviour

CLI — not supported. Accepted without error but never displayed, so control events such as Click are never raised.

Cloud — not supported. Accepted without error but never displayed, so control events such as Click are never raised.

Definition

public event Action<DroppedEventArgs> Dropped;
dropZone.Dropped += handler  # handler(obj: DroppedEventArgs)

Examples

var dropZone = new DropZone { Child = new TextBlock { Text = "Drop files" }, FilterExtensions = new[] { "csv" } };
dropZone.Dropped += args =>
{
    foreach (var filePath in args.FilePaths)
        Print("Dropped: {0}", filePath);
};
Chart.AddControl(dropZone);
def on_start(self):
    dropZone = DropZone()
    child = TextBlock()
    child.Text = "Drop files"
    dropZone.Child = child
    dropZone.Dropped += self.on_dropped
    api.Chart.AddControl(dropZone)

def on_dropped(self, args):
    for filePath in args.FilePaths:
        api.Print(f"Dropped: {filePath}")