Skip to content

ApplicationDraggableLocationChangedEventArgs

class cAlgo.API Since 5.2

DesktopCLICloud

Provides data for LocationChanged event of ApplicationDraggable.

Environment behaviour

CLI — not supported. Never raised in the CLI: the events that pass it never fire there (ApplicationDraggable.LocationChanged).

Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (ApplicationDraggable.LocationChanged).

Definition

public class ApplicationDraggableLocationChangedEventArgs

Namespace: cAlgo.API · Group: EventArgs

Examples

protected override void OnStart()
{
    var draggable = Application.Draggables.Add();
    draggable.Child = new TextBlock { Text = "Drag me" };
    draggable.LocationChanged += OnDraggableLocationChanged;
}

private void OnDraggableLocationChanged(ApplicationDraggableLocationChangedEventArgs args)
{
    Print("Draggable {0} moved to X: {1}, Y: {2}", args.Draggable.Id, args.Draggable.X, args.Draggable.Y);
}
def on_start(self):
    draggable = api.Application.Draggables.Add()
    text_block = TextBlock()
    text_block.Text = "Drag me"
    draggable.Child = text_block
    draggable.LocationChanged += self.on_draggable_location_changed

def on_draggable_location_changed(self, args):
    api.Print(f"Draggable {args.Draggable.Id} moved to X: {args.Draggable.X}, Y: {args.Draggable.Y}")

Properties

Name Description
DraggableDesktopCLICloudApplicationDraggable Gets the draggable.

See also