Ejemplo n.º 1
0
        /// <summary>
        /// Moves the node to the given target position and executes the given <see cref="Action">callback</see> at the end of the animation.
        /// </summary>
        /// <param name="targetPosition">The target position.</param>
        /// <param name="duration">The duration of the animation.</param>
        /// <param name="callback">The <see cref="Action">callback</see> executed at the end of the animation.</param>
        public void Move(Point3D targetPosition, double duration, Action callback)
        {
            var nodeMovedEventArgs = new NodeMovedEventArgs(duration, this.Position, targetPosition, callback);

            this.OnNodeMoved(nodeMovedEventArgs);
            this.Position = targetPosition;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Raises the <see cref="E:NodeMoved"/> event.
        /// </summary>
        /// <param name="args">The <see cref="Palmmedia.WpfGraph.UI.ViewModels.NodeMovedEventArgs"/> instance containing the event data.</param>
        protected virtual void OnNodeMoved(NodeMovedEventArgs args)
        {
            Logger.Debug("Moved node from: " + args.OldPosition + " to: " + args.NewPosition);

            if (this.NodeMoved != null)
            {
                this.NodeMoved(this, args);
            }
        }