Trouble with WindowsFormsHost

I am trying to get a MapPoint control displayed inside a WPF page and the instruction page has left me confused.

I have done everything up to (and including) creating this XAML:
<WindowsFormsHost x:Name="zoneAx" Canvas.Top="60" Canvas.Left="10" Width="780" Height="300">
and it compiles.  But I do not understand whether I should put something inside these tags, or if the name "zoneAX" must match the name used for the WinForms User Control.

Also, there is no "Loaded" event, so I have not completed the last 2 steps.

I would just love to see someone string with WPF explain how it all should fit, or even try and do it themselves by using the free MapPoint download.

Trial MapPoint (full version)

Hope to hear from you.  I am stuck and the project deadline would force me to not use WPF.


newbiewebSr. Software EngineerAsked:
Who is Participating?
bkokxConnect With a Mentor Commented:
The WindowsFormsHost  is a container, you do indeed need to add the child component:


<WindowsFormsHost x:Name="zoneAx" Canvas.Top="60" Canvas.Left="10" Width="780" Height="300">
     <me:UserControl1 x:Name="wfuc1"></me:UserControl1>

Or by in rumtime:

     zoneAx.Child = new UserControl1();
newbiewebSr. Software EngineerAuthor Commented:
I will give it a try...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.