Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
890
Performance issue when switching panel
posted

Hello,

  I have a TabGroupPane control with 8 ContePane, each ContePane have one XamDataGrid. When I switch from one Pane to another for the first time, it takes about 3 minutes to switch. Each XamDataGrid have approximately 100 rows and 50 Columns, with heavy custom styles. I suppose it's because the first time when we activate the pane, the DataGrid begins to Paint, and the rendering of visual elements has taken a lot of time. I have noticed that some other people are experiencing the same issue, and the solution proposed was to start a background thread and call "Activate" of each ContePane when launching the program to force the rendering of visual elements of each grid. This doesn't work for me for 2 reasons:

  1) To update the UI thread, I have to do Invoke in the UI thread by Dispatcher, which blocks the UI actions, which is not wanted

  2) Even if I call Invoke with a DispatchPriority.Background, it seems to no longer block the UI thread, but then I see that when calling "Activate" on each ContePane, the ContePane gets focus, stays focused for 3 seconds and then the next Pane gets focused, this is a too weird behavior that I can deliver to my client. I just want to force the paint on every Datagrid in the inactive Panes discretely when the client can continue to work in the active Pane. Is there a way to do it? I would highly appreciate if you can provide a sample. Thank you very much.