public void UpdatePos(BusCore bus, int delay) { double x = 0, y = 0; View.Dispatcher.Invoke(() => { x = Canvas.GetLeft(View); y = Canvas.GetTop(View); }); y -= 25; x += 25; bus.View.Dispatcher.Invoke(() => { Canvas.SetLeft(bus.View, x); Canvas.SetTop(bus.View, y); if (!canvas.Children.Contains(bus.View)) { canvas.Children.Add(bus.View); } }); }
public void RemoveBus(BusCore bus) { buses.Remove(bus); }
public void AddBus(BusCore bus) { buses.Add(bus); UpdatePos(bus, 0); }