Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]Welcome to DevExpress .NET Documentation
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Collapse]Map Control
   [Expand]Getting Started
    Layers
   [Expand]Coordinate Systems
   [Expand]Map Image Data
   [Expand]GIS Data
   [Expand]Vector Data
   [Expand]Visual Elements
   [Expand]End-User Interaction
   [Collapse]Examples
    [Collapse]General
      How to: Add a Map Control at Design Time
      How to: Add a Map Control via XAML
      How to: Add a Map Control via Code
      How to: Customize Navigation Elements
      How to: Add a Mini Map to the Map
      How to: Get a Bing Maps Key
    [Expand]Map Image Data
    [Expand]GIS Data
    [Expand]Vector Data
    [Expand]Printing and Exporting
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Add a Map Control via Code

This short introductory example describes how to add a Map Control to your WPF application in code.

  • Run the MS Visual Studio 2010, 2012, 2013, 2015 or 2017.

  • Create a new WPF Application project or open an existing one.
  • Open the Solution Explorer, right-click References and choose Add Reference... to add the Map Control Library.

  • Then, locate the DevExpress.Xpf.Map.v17.2 assembly and click it.

    Repeat this step to add the DevExpress.Data.v17.2 and DevExpress.Map.v17.2.Core references.

    Click OK to apply changes and close the window.

  • Write the following code (or something similar).

The MapControl has now been added to your application.

 

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E3610.

Expanded See Also

Is this topic helpful?​​​​​​​