Skip to content

Using the ThinkGeo UI Control for WPF in Your WinForms App

The ThinkGeo UI control for WPF is designed to produce professional-grade GIS applications, delivering maps with higher performance and responsiveness than our control for WinForms. But did you know that ThinkGeo’s WPF control can be used to enhance your WinForms apps as well?

Compared with ThinkGeo UI for WinForms, our WPF control offers additional perks like multi-tiled maps and overlay caching, providing an improved user experience. If your application in built using Windows Forms, you can still benefit from these perks by embedding ThinkGeo’s WPF map control in your WinForms app. You’ll get the UX improvements of our WPF control without having to redesign your application.

We’ve prepared a sample project that demonstrates how to take advantage of our WPF control’s specific features and apply them to a WinForms application.  Here are the benefits you’ll enjoy:

  • Instead of waiting for the entire map image to draw each time it needs to be refreshed, your map can render as a series of 512×512 tiles, each of which will appear as soon as it loads. This results in more efficient loading and enables users to start seeing the map much more quickly.
  • When panning the map, new tiles fill in on-the-fly as new areas are revealed, even before the pan operation completes. This helps your application feel much more responsive and offers a significant boost to the user experience.
  • Multi-threading gives you the ability to cache the map’s different overlays independently. This lets you locally cache more static data (such as a background overlay) so your application only spends time drawing the most important, dynamic data. This speeds up overall map rendering performance. Our sample project shows how to cache the background map as well as the ShapeFile layer on top of it.

Here’s how you can start using ThinkGeo’s WPF control in your WinForms application today:

  1. Create a new ElementHost component and add it to the form.  This is where the WPF map will be displayed.
  2. Create a new WPFMap object as a global variable.
  3. Set the WPFMap object to elementHost.child.

That’s it!

To make this even easier, we’ve built a sample project that demonstrates a ThinkGeo WPF control embedded on a Windows Form. Download it from GitHub at the link below:

https://github.com/ThinkGeo/UseWpfMapControlSample-ForWinforms

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *