void Value_PositionChanged(object sender, GraphX.Models.VertexPositionEventArgs args) { if (gg_arearesize.IsChecked == true) { var zoomtop = gg_zoomctrl.TranslatePoint(new Point(0, 0), gg_Area); //dg_Area.UpdateLayout(); var zoombottom = new Point(gg_Area.ActualWidth, gg_Area.ActualHeight); var pos = args.Position; if (pos.X < zoomtop.X) { GraphAreaBase.SetX(args.VertexControl, zoomtop.X, true); } if (pos.Y < zoomtop.Y) { GraphAreaBase.SetY(args.VertexControl, zoomtop.Y, true); } if (pos.X > zoombottom.X) { GraphAreaBase.SetX(args.VertexControl, zoombottom.X, true); } if (pos.Y > zoombottom.Y) { GraphAreaBase.SetY(args.VertexControl, zoombottom.Y, true); } } }
void Value_PositionChanged(object sender, GraphX.Models.VertexPositionEventArgs args) { var zoomtop = zoomctrl.TranslatePoint(new Point(0, 0), Area); var zoombottom = new Point(Area.ActualWidth, Area.ActualHeight); var pos = args.OffsetPosition; if (pos.X < zoomtop.X) { GraphAreaBase.SetX(args.VertexControl, zoomtop.X + 1, true); } if (pos.Y < zoomtop.Y) { GraphAreaBase.SetY(args.VertexControl, zoomtop.Y + 1, true); } if (pos.X > zoombottom.X) { GraphAreaBase.SetX(args.VertexControl, zoombottom.X, true); } if (pos.Y > zoombottom.Y) { GraphAreaBase.SetY(args.VertexControl, zoombottom.Y, true); } }