I am using xamDockManager in my application. I placed user control on each tab. the problem is that, every time I switch between tabs, it call UserControl_Loaded method, this will load my screen again and again. and call the dataload method again and again, which \kills the performance.
To resolve this, I place a boolean variable and on first load, I make it true and other time, if found true, return from the method.
If some one has some better way to handle it, using some property or other, it is highly appreciated.
Regards
Muhammad Sharjeel Ahsan
Thanks, I got it, this means that I am on the right path.
The TabGroupPane is a TabControl. When you change tabs in a tab control the content comes out of the visual tree and its Unloaded event gets invoked and its Loaded event is reinvoked when it reenters the tree. If you want to avoid performing your initialization code multiple times you could use a flag as you have or you could unhook the loaded event in the loaded event handler.