private void UpdatePosition()
        {
            Point positionConnectPoint;

            if ((!ViewModel.Node.IsCollapse) || (ViewModel.Node.IsCollapse && this.ViewModel.Name == "Output"))
            {
                positionConnectPoint = EllipseElement.TranslatePoint(new Point(EllipseElement.Width / 2, EllipseElement.Height / 2), this);

                NodesCanvas NodesCanvas = MyUtils.FindParent <NodesCanvas>(this);

                positionConnectPoint = this.TransformToAncestor(NodesCanvas).Transform(positionConnectPoint);

                //positionConnectPoint = positionConnectPoint.Division(this.ViewModel.NodesCanvas.Scale.Value);
            }
            else
            {
                positionConnectPoint = this.ViewModel.Node.Output.PositionConnectPoint;
            }

            if (this.ViewModel.Name == "Output")
            {
                this.ViewModel.NodesCanvas.LogDebug(positionConnectPoint.ToString());
            }
            this.ViewModel.PositionConnectPoint = positionConnectPoint;
        }
        private void OnMouseMoves(MouseEventArgs e)
        {
            NodesCanvas NodesCanvas = MyUtils.FindParent <NodesCanvas>(this);

            ViewModel.EndPoint = e.GetPosition(NodesCanvas.CanvasElement);

            e.Handled = true;
        }
示例#3
0
        void UpdatePosition()
        {
            Point positionConnectPoint = EllipseElement.TranslatePoint(new Point(EllipseElement.Width / 2, EllipseElement.Height / 2), this);

            NodesCanvas NodesCanvas = MyUtils.FindParent <NodesCanvas>(this);

            if (NodesCanvas == null)
            {
                return;
            }

            positionConnectPoint = this.TransformToAncestor(NodesCanvas).Transform(positionConnectPoint);

            //this.ViewModel.PositionConnectPoint = positionConnectPoint.Division(this.ViewModel.NodesCanvas.Scale.Value);
            this.ViewModel.PositionConnectPoint = positionConnectPoint;
        }