コード例 #1
0
        public void MapTimedViewModel_Initialize_CorrectRoute()
        {
            var data  = Factories.GetRouteData();
            var model = new MapTimedViewModel(data);

            model.Initialize();
            model.SliderValueChanged(2);

            List <Microsoft.Maps.MapControl.WPF.MapPolyline> locations = new List <Microsoft.Maps.MapControl.WPF.MapPolyline>();
            var arrow = new Microsoft.Maps.MapControl.WPF.MapPolyline();
            var line  = new Microsoft.Maps.MapControl.WPF.MapPolyline();

            Setup(line);

            line.Locations = new LocationCollection();

            for (int i = 0; i < 2; i++)
            {
                var loc = data.Route.ElementAt(i);
                line.Locations.Add(new Location(loc));
            }

            arrow = GetArrow(data.Route.First(), data.Route.ElementAt(1));

            locations.Add(line);
            locations.Add(arrow);

            Assert.IsTrue(CompareMapPolylines.compare(locations.ElementAt(0), model.MapPolylines.ElementAt(0)));
            Assert.IsTrue(CompareMapPolylines.compare(locations.ElementAt(1), model.MapPolylines.ElementAt(1)));
        }
コード例 #2
0
ファイル: MapTimed.xaml.cs プロジェクト: DELTAJoSch/dip-cider
        /// <summary>
        /// This function is called when the slider value changes
        /// </summary>
        /// <param name="sender">The object that called this method</param>
        /// <param name="e">The event args this was called with</param>
        public void slValueChanged(object sender, EventArgs e)
        {
            model.SliderValueChanged((int)slValue.Value);

            map.SetView(model.MapCenter, model.MapZoomLevel);
        }