Beispiel #1
0
        private void DrawMap()
        {
            Debug.Assert(Map != null);

            MapField.LayoutTransform = new ScaleTransform(Map.CanvasTransform, Map.CanvasTransform);
            MapField.UpdateLayout();
            foreach (Polyline line in Map.Obstacles)
            {
                Polyline newLine = new Polyline
                {
                    Points          = TranslateCoordinates(line.Points),
                    Stroke          = Brushes.SlateGray,
                    StrokeThickness = StrokeWidth,
                    FillRule        = FillRule.EvenOdd
                };
                MapField.Children.Add(newLine);
            }

            Polyline goal = new Polyline
            {
                Points          = TranslateCoordinates(Map.Goal.Points),
                Stroke          = Brushes.Aqua,
                StrokeThickness = StrokeWidth,
                FillRule        = FillRule.EvenOdd
            };

            MapField.Children.Add(goal);
        }