Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop Wpf Tabcontrol to unload Visual tree on Tab change

Tags:

wpf

tabcontrol

Hi My usercontrols placed in tabs are unloaded and loaded every time the tabs are changed.It creates some unnecessary lag in the application.I am looking for some way to fix this behavior.I know i have to subclass tabcontrol to change this behavior but how..?

like image 664
biju Avatar asked Feb 18 '11 05:02

biju


1 Answers

You can find two different approaches to prevent this in this StackOverflow question:

  • WPF TabControl - how to preserve control state within tab items (MVVM pattern)

I recommend:

  • Keeping the WPF Tab Control from destroying its children
like image 106
Rick Sladkey Avatar answered Oct 22 '22 09:10

Rick Sladkey