VERIFIED SOLUTION i
X

How to host the MapXtreme WinForm Controls in WPF

UPDATED: April 18, 2017


Officially, MapXtreme doesn't support WPF.

However, you can host the MapXtreme WinForm Controls in WPF by the following steps.
  1. Ensure that the WindowsFormIntegration Reference and the required MapXtreme control dlls are present in the reference properties of WPF application and add the namespace in xaml.cs file System.Windows.Forms.Integration
  2. Add the WindowsFormsHost element in XAML as follows.
In the Window element, add the following namespace mapping. The mycontrol namespace mapping establishes a reference to the assembly that contains the Windows Forms control.
 
xmlns:mycontrol="clr-namespace:MapInfo.Windows.Controls;assembly=MapInfo.CoreEngine"
 
In the Grid element add the following XAML.
The MapControl is created as a child of the WindowsFormsHost control.
<Grid>
<WindowsFormsHost>
<mycontrol:MapControl x:Name="mapControl1"/>
</WindowsFormsHost>
</Grid>

For more details refer https://msdn.microsoft.com/en-us/library/ms742875(v=vs.110).aspx
 

Downloads

  • No Downloads