ThinkGeo.com    |     Documentation    |     Premium Support

ElementHost and WPF

We are seeing some strange sizing results of the WPF control when we host it inside a winforms MDI windows applicaiton.


We have our WPF usercontrol which contains the map control on bottom and a ribbon control on top.  This looks fine just as a WPF control but when we host it in a winforms app, The control seems to not recognize the bondaries of our WPF stack panel but instead resizes to the boundaries of the winforms window.  Is this a know issue with hosting the WPF control inside a winforms app? 



I attached an example of what I'm seeing.  The attachement is a windows form which contains a ElementHost.


The WPF control is what you see inside the Element Host at runtime.  You can see the map control on top of the ribbon control.  When look at this control inside a WPF app, the map window is below and the ribbon is above.  Both are contained inside a grid.



1725-Interop.JPG (10.4 KB)

Peter, 
  
 Thanks for your post. 
  
 We can not recreate your problem. In order to solve your problem and make the problem clear, could you provide a simple sample? That way we can go directly to resolving your problem instead of spending time setting up your scenario and trying to recreate the error on our side. If you don’t fell comfortable sending your project in the Discussion Forum, you can use one of your Support tickets in the Customer Portal.  
  
 Thanks  
  
 James 


Thanks for the response.  I figured out the problem.  If I set the top margin of my usercontrol, which holds the ThinkGeo control, to some value.  That usercontrol doesn’t overlap the control above it.  My situation was we had a WPF usercontrol which contained two other user controls.  One was a ribbon and the other was the ThinkGeo Map.  As long as I make sure the master control sets the Margin of any sub user controls correctly instead of assuming a Grid will take care of positioning, everything works great.

Peter, 
  
 Thanks for your sharing, I am glad you are making progress. 
  
 Any more questions just feel free to let me know. 
  
 Thanks. 
  
 Yale