Пример #1
0
        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);
                }
            });
        }
Пример #2
0
 public void RemoveBus(BusCore bus)
 {
     buses.Remove(bus);
 }
Пример #3
0
        public void AddBus(BusCore bus)
        {
            buses.Add(bus);

            UpdatePos(bus, 0);
        }