Articles in this section
Category / Section

How to host Maps.WPF to WinForms?

1 min read

You can host the WPF Map control into WinForms by following the given steps:

  1. Create a new project and select the WPF User Control Library template under the Windows Desktop category.
  2. Initialize the maps control and define the required features either in the UserControl1.xaml or UserControl1.cs file available in the created WPF user control library.
  3. Create a new Windows Forms Application template under the Windows Desktop category.
  4. In the Solution explorer of windows forms application, right-click and add the WPF User Control Library as existing project.
  5. Add this library project as reference to the Windows Forms Application by clicking Add Reference in RefernceManager of WinForms application.
  6. Initialize and add the UserControl1 defined in the WPF user control library in the Form1.cs file.
    Note:

    Add the following references in WPF User Control Library.

    • WindowsBase
    • PresentationCore
    • PresentationFramework
    • System

     

    Add the following references in Windows Forms Application.

    • PresentationCore
    • PresentationFramework
    • System.Xaml
    • WindowsBase
    • WindowsFormsIntegration

     

Sample for host the WPF maps control into WinForms: https://www.syncfusion.com/downloads/support/directtrac/general/ze/WFHost-1254467776

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied