简体   繁体   中英

How to load all tabs before Ribbon Window is displayed in WPF?

I am using WPF ribbon control of Microsoft. I have three tabs with each tab loading different WPF user-controls. I used a splash screen until the main window is loaded. After main ribbon window is loaded, once the user click another Ribbon-Tab it takes 3 - 4 seconds for that tab to be rendered and displayed. However this happens only for the first time. After that switching tabs don't show any delay.

Additional info: I initialized all user controls before the window is rendered, including the user-controls used in all tabs.

I found a hack by moving the window out of the screen when launched and then bring back after switching all tabs programatically. However I read that in Windows 8 if you move the window out of screen the Window operations are suspended in memory.

How to make the tab switching and UI responsive? All suggestions are welcome.

I could'nt entirely avoid the delay, however I was able to mitigate the issue by putting a processing rotating icon overlay while changing tabs. This can be done by calling dispatcher.invokelater on the UI thread while user clicks other tab, and closing the icon when the new tab is loaded.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM