private static void UpdateCoordinates(DependencyObject obj, double horizontalChange, double verticalChange) { if (double.IsNaN(GraphAreaBase.GetX(obj))) { GraphAreaBase.SetX(obj, 0, true); } if (double.IsNaN(GraphAreaBase.GetY(obj))) { GraphAreaBase.SetY(obj, 0, true); } //move the object var x = GraphAreaBase.GetX(obj) + horizontalChange; GraphAreaBase.SetX(obj, x, true); var y = GraphAreaBase.GetY(obj) + verticalChange; GraphAreaBase.SetY(obj, y, true); if (GetUpdateEdgesOnMove(obj)) { UpdateVertexEdges(obj as VertexControl); } }
/// <summary> /// Set attached coordinates X and Y /// </summary> /// <param name="pt"></param> /// <param name="alsoFinal"></param> public void SetPosition(Point pt, bool alsoFinal = true) { GraphAreaBase.SetX(this, pt.X, alsoFinal); GraphAreaBase.SetY(this, pt.Y, alsoFinal); }