# Performance when hosted in Actipro tabbed window

**URL:** <https://community.thinkgeo.com/t/performance-when-hosted-in-actipro-tabbed-window/887>\
**Category:** WinForms\
**Created:** [November 30, 2009, 4:25pm UTC](https://community.thinkgeo.com/t/performance-when-hosted-in-actipro-tabbed-window/887 "2009-11-30T16:25:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@Greg](https://community.thinkgeo.com/u/Greg)\
**Post date:** [November 30, 2009, 4:25pm UTC](https://community.thinkgeo.com/t/performance-when-hosted-in-actipro-tabbed-window/887/1 "2009-11-30T16:25:10Z")

</div>

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

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

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

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

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

Thanks,

Greg

&nbsp;

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [November 30, 2009, 8:03pm UTC](https://community.thinkgeo.com/t/performance-when-hosted-in-actipro-tabbed-window/887/2 "2009-11-30T20:03:59Z")

</div>

Greg,

Following&nbsp;solution&nbsp;can&nbsp;give&nbsp;you&nbsp;some&nbsp;idea&nbsp;of&nbsp;how&nbsp;to&nbsp;get&nbsp;the&nbsp;drawing&nbsp;time&nbsp;of&nbsp;all&nbsp;the&nbsp;overlays&nbsp;in&nbsp;the&nbsp;MapControl:  
&nbsp;  
Hook&nbsp;up&nbsp;the&nbsp;events&nbsp;as&nbsp;following:  
`wpfMap1.OverlaysDrawing += new System.EventHandler<OverlaysDrawingWpfMapEventArgs>(wpfMap1_OverlaysDrawing);wpfMap1.OverlaysDrawn += new System.EventHandler<OverlaysDrawnWpfMapEventArgs>(wpfMap1_OverlaysDrawn);`  
&nbsp;  
Try&nbsp;to&nbsp;get&nbsp;the&nbsp;time&nbsp;as&nbsp;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());        }`  
&nbsp;  
Any&nbsp;more&nbsp;quesiotns&nbsp;just&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.  
&nbsp;  
Thanks.  
&nbsp;  
Yale

---

<div class="post-metadata">

**Author:** ![Greg](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/71c47a/32.png) [@Greg](https://community.thinkgeo.com/u/Greg)\
**Post date:** [December 1, 2009, 1:10pm UTC](https://community.thinkgeo.com/t/performance-when-hosted-in-actipro-tabbed-window/887/3 "2009-12-01T13:10:24Z")

</div>

Hi&nbsp;Yale,

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

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

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

Thanks,

Greg

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [December 1, 2009, 7:29pm UTC](https://community.thinkgeo.com/t/performance-when-hosted-in-actipro-tabbed-window/887/4 "2009-12-01T19:29:11Z")

</div>

Greg,

Thanks&nbsp;for&nbsp;your&nbsp;post&nbsp;and&nbsp;information.  
&nbsp;  
If&nbsp;the&nbsp;screen&nbsp;continues&nbsp;to&nbsp;repaint,&nbsp;which&nbsp;means&nbsp;some&nbsp;overlays&nbsp;is&nbsp;set&nbsp;to&nbsp;base&nbsp;somehow&nbsp;by&nbsp;following&nbsp;statement.&nbsp;Could&nbsp;you&nbsp;double&nbsp;check&nbsp;this?  
`layerOverlay.IsBase = true;`  
&nbsp;  
I&nbsp;am&nbsp;wondering&nbsp;how&nbsp;many&nbsp;overlays&nbsp;are&nbsp;you&nbsp;trying&nbsp;to&nbsp;use&nbsp;now,&nbsp;and&nbsp;all&nbsp;of&nbsp;them&nbsp;are&nbsp;base&nbsp;or&nbsp;some&nbsp;of&nbsp;them&nbsp;are&nbsp;base&nbsp;overlays?&nbsp;Could&nbsp;you&nbsp;try&nbsp;setting&nbsp;none&nbsp;of&nbsp;them&nbsp;into&nbsp;base&nbsp;overlay&nbsp;to&nbsp;see&nbsp;its&nbsp;difference&nbsp;in&nbsp;Actipro&nbsp;hosted&nbsp;and&nbsp;Window&nbsp;hosted&nbsp;versions?  
&nbsp;  
Also,&nbsp;you&nbsp;could&nbsp;play&nbsp;with&nbsp;following&nbsp;event&nbsp;which&nbsp;will&nbsp;be&nbsp;fired&nbsp;for&nbsp;each&nbsp;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");}`  
&nbsp;  
Any&nbsp;more&nbsp;questions&nbsp;just&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.  
&nbsp;  
Thanks.  
&nbsp;  
Yale
