public void DestroyOutputLine()
 {
     if (outboundLine != null)
     {
         //destroy it
         outboundLine.DeleteLine();
         outboundLine = null;
     }
 }
        private void ParamGate_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (sender is ParamIOGate)
            {
                ParamIOGate paramGate = sender as ParamIOGate;

                if (paramGate.IsConnecting)
                {
                    Point currPos =
                         new Point(e.GetPosition(ParamCanvas).X,
                                   e.GetPosition(ParamCanvas).Y);

                    //Validate the collision 
                    if (IsValidConnection(currPos, paramGate))
                    {
                        //update it here
                        UpdateInboundParam(currPos, paramGate);
                        outboundLine = paramGate.ConnectionLine;

                        ParamValueChangesEvent(new EventArgs()); //Commitment was made
                    }
                    else
                    {
                        UndoLineDrawing(paramGate);
                    }

                    paramGate.IsConnecting = false;
                    paramGate.ReleaseMouseCapture();
                }
            }
        }