/// <summary>
        /// Handles the MouseUp event.
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        public bool MouseUp(MouseEventArgs e)
        {
            if (IsActive)
            {
                SelectionManager.UnselectAll();

                if (Canvas.IsMouseCaptured && !GhostManager.Rectangle.IsEmpty)
                {
                    AddShape(GhostManager.Rectangle);
                }
                DeactivateTool();
                GhostManager.Release();
                return(true);
            }
            return(false);
        }
示例#2
0
        /// <summary>
        /// Handles the MouseUp event.
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        public bool MouseUp(MouseEventArgs e)
        {
            if (IsActive)
            {
                SelectionManager.UnselectAll();

                if (Canvas.IsMouseCaptured)
                {
                    CreateConnectionCommand cmd = new CreateConnectionCommand(initialPoint, e.GetPosition(Canvas), Canvas);
                    UndoManager.Execute(cmd);
                }
                DeactivateTool();
                GhostManager.Release();
                return(true);
            }
            return(false);
        }