示例#1
0
        public MainWindow()
        {
            InitializeComponent();

            _places = new PlaceContainer();
            foreach (var pers in Persons.Users)
            {
                _places.AddPerson(pers.Schedule[Time.T0]);
            }

            _layout = new Layout(cvs.Width, cvs.Height, _places.GetPlaces);
            cvs.Children.Add(_layout.Visuals);

            _way = new Way(_places.GetWay(0, 0));
            _layout.Drawables.Add(_way);
            _layout.Refresh();

            foreach (var i in Places.Names)
            {
                FromBox.Items.Add(i);
                ToBox.Items.Add(i);
            }

            FromBox.SelectedIndex = 0;
            ToBox.SelectedIndex   = 0;
        }
示例#2
0
        private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            var slide = (Slider)sender;
            var val   = (int)slide.Value;

            HourLabel.Content = $"Hour: {val:00}:00";

            foreach (var place in _places.GetPlaces)
            {
                place.NumberOfPeople = 0;
            }

            foreach (var pers in Persons.Users)
            {
                _places.AddPerson(pers.Schedule[(Time)val]);
            }


            _layout.ChangeVerticles(_places.GetPlaces);

            var way = _places.GetWay(start, finish);

            _layout.Drawables.Remove(_way);
            _way = new Way(way);
            _layout.Drawables.Add(_way);

            _layout.Refresh();
        }