Пример #1
0
        protected override void OnRenderCore(DrawingContext dc, RenderState state)
        {
            if (DataSource == null) return;
            if (Marker == null) return;

            Rect bounds = Rect.Empty;
            using (IPointEnumerator enumerator = DataSource.GetEnumerator(GetContext()))
            {
                Point point = new Point();
                while (enumerator.MoveNext())
                {
                    enumerator.GetCurrent(ref point);
                    enumerator.ApplyMappings(Marker);

                    Point screenPoint = point.Transform(state.Visible, state.Output);

                    bounds = Rect.Union(bounds, point);
                    Marker.Render(dc, screenPoint);
                }
            }

            ContentBounds = bounds;
        }