ThinkGeo.com    |     Documentation    |     Premium Support

How to dock the WPF map control onto a parent

I have an issue regarding making the WPF map control fill the entire espace available in its container.


I've simplified my WPF markup code and ended up with something like:


 <Window x:Class="Shapes.OnlyMap"

    xmlns="schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="schemas.microsoft.com/winfx/2006/xaml"

    Title="OnlyMap" Height="300" Width="300" xmlns:my="clr-namespace:ThinkGeo.MapSuite.DesktopEdition;assembly=DesktopEdition" Loaded="Window_Loaded">

    <Grid>

        <my:WpfMap Name="wpfMap" Margin="0" Width="270" Height="250" />

    </Grid>

</Window>


But when I resize or maximize the window, the map control stays the same way, of course. I've tried to hook on the SizeChanged event, but that turned out being kind of slow. So the question is how to do it in the simplest way possible? The WPF map control has some kind of weird behavior when resizing and dragging it on the VS 2008 WPF design surface, and doesn't dock as the other WPF standard controls do.


 



Gustavo,



Sorry for the inconvenience. The resizing issue of Wpf map control is a known issue; which can be simply fixed by the SizeChanged event of its parent; please see the attached sample for detail. On the other hand; we will have a new Wpf map control release soon in a few days which automatically fits its parent size. Welcome to evaluate our new Wpf map control and please keep an eye on our website.



Just let us know if you have more questions.



Thanks,

Howard



2019-Post7450.zip (8.45 KB)

Hi Howard, I tried the MapSuite 4.0 but still I’m not able to dock the map control on its parent. I have the same issues as before. Would it be possible to send a working sample to the new version?  I’m using VS 2008.

Gustavo,



I'm glad to show you a sample here, please see the attachment for detail. Our new Wpf Desktop beta is not released this time for some reason. Please keep an eye on our website and sorry for the inconvenience.



Thanks,

Howard



2033-Post7450.zip (8.55 KB)

Thank you very much for the reply Howard.


I've posted further details about my issue in the following thread: gis.thinkgeo.com/Support/Dis...aspx#16751 as the dock and the scale issues that I have turned out to be related.



Gustavo, 
  
 Yes, I agree, let us keep one thread alive. 
  
 Thanks. 
  
 Yale 


Hello, 
 Currently I’m evaluating ThinkGeo Desktop and I have one related issue.  
 If you run the code in Post7450.zip, the resize problem is fixed. However, when I drag the map itself, it first blanks out en reappears when I release the mouse button. Is there a fix for this problem?  I’m using VS2010, WPF, Evaluation version of ThinkGeo and complete newbie regarding ThinkGeo and GIS (so don’t shoot me!).  
 Your help is appreciated. I’ve created a similar piece of code and I discovered that the problem only appears if you handle the SizeChange event from on the parents of the container. 
  
 Thank you.

Sander, 
  
 I have tested Post7450.zip sample, it works. I just want to make sure your problem, is that when you pan the map control, during the dragging the whole map or just part of map will disappear, it will redraw again after release mouse? 
  
 Could you provide your test environment and which version(File Version) of DesktopEdition.DLLyou are using? 
  
 Thanks 
 James

Sander and James,


may be it is the same issue I have posted in the following thread:


gis.thinkgeo.com/Support/Dis...fault.aspx


Thomas



Hello James,


You're correct: the map control blanks when I drag the map when I run the application.


I'm using version 4.5.0.0 and runtime version v2.0.50727 (note that I'm using the evaluation version, you can expect our order in a few days). We're using VS2010.


The same happens when I run my own WPF application, but only after resizing the window (and the mapcontrol too).


The problem might not appear on first (resizing) try, but after a few resizings, the resolution of the map seems to change and the blanking out during map dragging problem appears. Since I'm new to ThinkGeo it might be use/swdevelopper error, but the same happens in the sample posted (BTW: Compilation of the source code is fine, no problems)


Let me know if you need any additional information.


Kind regards.


Sander



Hi Thomas,


Thank you for the link. I see you're experiencing some flickering too. On our programs the map does reappear after releasing the mouse button. We are currently running in single thread mode, but I might be worth mentioning that I'm using Windows 7 64 bits OS.


Kind regards,


Sander


 



Sander,


Still we cannot recreate your problem. We downloaded Post7450.zip, reference 4.5.0.0 assemblies and try it on a Win7 X64 system, it is working fine that there is no blank out during the panning or resizing. So can you provide a short video for this to demonstrate this issue?
There is a pretty good free tool called “Jing” with which you can easily create a video less than 5 minutes, I think you can try this. Also if the video is too big to put here, you can email us with ForumSupport@thinkgeo.com or connect support@thinkgeo.com for uploading.
Thanks,
Ben