Switching between tabs in a docking window is slow

Docking/MDI for WPF Forum

Posted 7 years ago by Tony Pulokas
Version: 11.2.0551
Avatar

Hello,

We have a Entity Framework backed desktop application that we are creating.  It has 2 docksites, a ribbon area with several tabs, and a few tabs open in the docksites.

We've noticed a significant performance problem with the docksites.  The problem tab will contain a datagrid, with ~400 rows and 8 columns.  Each has a ViewModel with an EntityObject.  The problem is additive - more cells lead to a longer switching time.  Once in the tab, performance is normal.  Turning virtualization on the grid doesn't affect this problem.

The problem is when switching between a problem tab and another non-problem tab:

  • There is about a 3-second delay switching FROM the problem tab
  • There is a memory decrease of about 12MB when switching FROM the problem tab
  • There is a 4-second delay when switching TO the problem tab.
  • There is a memory increase of about 12MB when switching TO the problem tab

When I profiled it, there appears to be a large amout of time spent in UpdateLayout().  We aren't calling this directly, and I don't see anything in our code that could be causing this problem.  The highlighted portion of the sample is purely switching back and forth between tabs 10x via mouse.

I have uploaded 2 screenshots for visual - one is the program, the other is the profile in question (http://www.theimagedepot.com/p377396986) pw: actipro

What I think is that every cell in our datagrid is having something done to it when switching tabs, and I'm really looking for a pointer on how to debug this.  With another control we are using, there was a default behavior we could disable when switching focus in tabs that caused a similar delay (switching the tab caused the control to be unloaded, so I disabled that behavior).  It also looks like the DockingWindowContainer is spending a lot of time on OnSelectionChanged - is this for the Window, the Tab, or the individual items in the datagrid?

Thanks!

Comments (3)

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Tony,

The tool window containers work similarly to a TabControl in that they present the content of the currently-selected tab.  If you are using the DockSite MVVM-style, have you tried the preserve visuals feature in the "MVVM Features" documentation topic, within the "Item Containers" section?  I'm curious if that would help.


Actipro Software Support

Posted 7 years ago by Tony Pulokas
Avatar

We have a single docksite, and I believe that feature is already enabled, unfortunately.

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Tony,

Sorry but it's hard to say what else to try, as I'm not sure what else to suggest.  We just present the content of the tab in a ContentPresenter, similar to a TabControl.  Reducing visual counts always helps in scenarios like this.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.