ThinkGeo.com    |     Documentation    |     Premium Support

Performance when hosted in Actipro tabbed window

I'm having a performance problem when using the WpfMap in conjunction with another third-party tool, the Actipro Software dockable windowing kit for WPF.  We're using the Actipro API to create a flexible windowing solution like you see in VS or Eclipse, and we'd like to include the WpfMap as something that can be "dockable".  


I noticed that when I host my WpfMap in a UserControl that is then hosted in an Actipro TabbledWindow, the apparent refresh speed goes way down during a pan and zoom operation.  These kinds of problems are difficult to address since there are multiple parties involved, but perhaps someone else has experienced this problem or can explain what might be causing the problem.


I captured some DrawingTime metrics from both a WPF Window hosted WpfMap and an Actipro TabbedWindow hosted map.  The metrics are the same for DrawingTime in both cases, so I think it is more a matter of refresh frequency.


Are there any other properties like DrawingTime that I could look at that may help?  How does WpfMap get notified that a pan is occurring?  Perhaps there is something related to how WpfMap hooks into parent events, and the Actipro software raises events in a different way.


I'd like to understand more about what leads up to a refresh because perhaps that will give me a path to work this through with the Actipro people.


Thanks,


Greg


 



Greg,


Following solution can give you some idea of how to get the drawing time of all the overlays in the MapControl:
 
Hook up the events as following:

wpfMap1.OverlaysDrawing += new System.EventHandler<OverlaysDrawingWpfMapEventArgs>(wpfMap1_OverlaysDrawing);
wpfMap1.OverlaysDrawn += new System.EventHandler<OverlaysDrawnWpfMapEventArgs>(wpfMap1_OverlaysDrawn);

 
Try to get the time as following:

        Stopwatch s = new Stopwatch();
        void wpfMap1_OverlaysDrawn(object sender, OverlaysDrawnWpfMapEventArgs e)
        {
            s.Start();
        }

        void wpfMap1_OverlaysDrawing(object sender, OverlaysDrawingWpfMapEventArgs e)
        {
            s.Stop();
            System.Diagnostics.Debug.WriteLine(s.Elapsed.TotalSeconds.ToString());
        }

 
Any more quesiotns just feel free to let me know.
 
Thanks.
 
Yale

Hi Yale,


Thanks for the code.  I used s.Reset() instead of s.Stop() and flopped where the Start and Reset (Stop) occur.


What I'm seeing is that the overrlay drawing time is actually about the same for both the Actipro and Window hosted versions.  During a pan, I noticed that the OverlaysDrawn callback is only called upon a mouse release, but the screen continues to repaint as I pan.  It is this repaint that is slower when your software is hosted in Actipro.


Is there a way to capture the timing around each paint during a pan operation?


Thanks,


Greg



Greg,


Thanks for your post and information.
 
If the screen continues to repaint, which means some overlays is set to base somehow by following statement. Could you double check this?

layerOverlay.IsBase = true;

 
I am wondering how many overlays are you trying to use now, and all of them are base or some of them are base overlays? Could you try setting none of them into base overlay to see its difference in Actipro hosted and Window hosted versions?
 
Also, you could play with following event which will be fired for each overlay:

wpfMap1.OverlayDrawing += new System.EventHandler<OverlayDrawingWpfMapEventArgs>(wpfMap1_OverlayDrawing);
wpfMap1.OverlayDrawn += new System.EventHandler<OverlayDrawnWpfMapEventArgs>(wpfMap1_OverlayDrawn);

void wpfMap1_OverlayDrawn(object sender, OverlayDrawnWpfMapEventArgs e)
{
    System.Diagnostics.Debug.WriteLine("wpfMap1_OverlayDrawn");
}

void wpfMap1_OverlayDrawing(object sender, OverlayDrawingWpfMapEventArgs e)
{
    System.Diagnostics.Debug.WriteLine("wpfMap1_OverlayDrawing");
}

 
Any more questions just feel free to let me know.
 
Thanks.
 
Yale