public WorkflowEditorUserControl() { InitializeComponent(); _myLines = new List <CustomPath>(); DataContextChanged += WorkflowEditorUserControl_DataContextChanged; SizeChanged += (sender, args) => MouseHelper.ClearMouseTrap(); }
/// <summary> /// Finishes the drag and drop action /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FinishMoving(object sender, MouseButtonEventArgs e) { MouseHelper.ClearMouseTrap(); if (_selectedComponent != null) { _startPoint = new Point(); MouseMove -= MoveComponent; _selectedComponent = null; } if (_customPath != null) { MouseMove -= MovePath; editorCanvas.Children.Remove(_customPath.Path); if (CurrentHoveredComponent != null) { AddConnection(_customPath.Source, (CurrentHoveredComponent as WorkflowComponentUserControl).Component); } _customPath = null; DrawCanvas(this, null); } }