ThinkGeo.com    |     Documentation    |     Premium Support

Missing GeoCanvas in DrawCore migrating to Wpf

Hi,

I am doing some work to investigate converting our application from WinForms to Wpf. In our current (WinForms) application we do a lot of custom drawing by overriding DrawCore in the EditInteractiveOverlay and other interactive overlays. We use the canvas argument passed to DrawCore for our drawing. I have been unable to see how we could accomplish the same thing in the Wpf version of MapSuite. Can we create a GeoCanvas (PlatformGeoCanvas?) inside DrawCore and use it for our custom drawing?

Thanks!

Steve

Hi Steve,

In WPF you should want to override the function DrawTileCore.

Please notice:

  1. The canvas here is DrawingVisualGeoCanvas. DrawingVisualGeoCanvas drawingVisualGeoCanvas = geoCanvas as DrawingVisualGeoCanvas;
  2. In WPF each tile is a standalone control, so the DrawTileCore works for each tile. If your logic is works for entire map, please modify it to suitable the drawingVisualGeoCanvas.CurrentWorldExtent.

Wish that’s helpful.

Regards,

Ethan

Ethan,

That did it. Thanks for your help.

Steve

Hi Steven,

I am glad to hear that’s helpful.

Regards,

Ethan