private void StopDraggingPin() { if (IsDraggingPin) { if (PreviewConnection.IsValidDrop && PreviewConnection.DropTarget != null) { ConnectPins(DraggedPin, PreviewConnection.DropTarget); } else { CKlaxScriptNodeQueryContext queryContext = new CKlaxScriptNodeQueryContext { InputPinType = DraggedPin.GetPinType(), IsExecPin = DraggedPin.IsExecutionPin(), QueryObject = ScriptGraph.ScriptableObject, }; m_addNodePoint = ((NodeGraphView)Content).GetPasteReferenceLocation(); AddNodeViewModel.SetContext(queryContext); AddNodeViewModel.IsOpen = true; m_addNodeContextPin = DraggedPin; } } PreviewConnection.IsVisible = false; PreviewConnection.IsValidDrop = false; PreviewConnection.DropTarget = null; IsDraggingPin = false; Mouse.OverrideCursor = null; }
private void StartDraggingPin() { IsDraggingPin = true; PreviewConnection.IsVisible = true; PreviewConnection.StartPoint = DraggedPin.GetConnectionPointCanvas(); PreviewConnection.EndPoint = DraggedPin.GetConnectionPointCanvas(); PreviewConnection.StrokeColor = DraggedPin.PinOuterColor; AddNodeViewModel.IsOpen = false; m_addNodeContextPin = null; }