public void AddLink(PlanetDrawing planet1, PlanetDrawing planet2) { if (planet1 == planet2 && LinkDrawings.Any(l => (l.Planet1 == planet1 && l.Planet2 == planet2) || (l.Planet2 == planet1 && l.Planet1 == planet2))) return; var d = new LinkDrawing(planet1, planet2); LinkDrawings.Add(d); canvas.Children.Add(d); Panel.SetZIndex(d, 2); GalaxyUpdated(); }
public void AddLink(PlanetDrawing planet1, PlanetDrawing planet2) { if (planet1 == planet2 && LinkDrawings.Any(l => (l.Planet1 == planet1 && l.Planet2 == planet2) || (l.Planet2 == planet1 && l.Planet1 == planet2))) { return; } var d = new LinkDrawing(planet1, planet2); LinkDrawings.Add(d); canvas.Children.Add(d); Panel.SetZIndex(d, 2); GalaxyUpdated(); }
public void RemoveLink(LinkDrawing link) { LinkDrawings.Remove(link); canvas.Children.Remove(link); }