コード例 #1
0
        void thumbDragThumb_DragCompleted(object sender, DragCompletedEventArgs e)
        {
            if (HitConnector != null)
            {
                if (connection != null)
                {
                    if (connection.Source == fixConnector)
                    {
                        bool canMove = designerCanvas.CanMoveLinkTarget(connection.Source.ParentDesignerItem, connection.Sink.ParentDesignerItem, this.HitConnector.ParentDesignerItem);
                        if (canMove)
                        {
                            designerCanvas.OnMoveLinkTarget(connection.Source, connection.Sink, this.HitConnector);
                            connection.Sink = this.HitConnector;
                        }
                    }
                    else
                    {
                        bool canMove = designerCanvas.CanMoveLinkSource(connection.Source.ParentDesignerItem, connection.Sink.ParentDesignerItem, this.HitConnector.ParentDesignerItem);
                        if (canMove)
                        {
                            designerCanvas.OnMoveLinkSource(connection.Source, connection.Sink, this.HitConnector);
                            connection.Source = this.HitConnector;
                        }
                    }
                }
            }

            this.HitDesignerItem            = null;
            this.HitConnector               = null;
            this.pathGeometry               = null;
            this.connection.StrokeDashArray = null;
            this.InvalidateVisual();
        }