tags:

views:

15

answers:

1

So I have two tab items within a tab. I am data binding on both. If when i click the second tab item the memory goes through the roof. Looks like it is lazy loading or something. So if i don't click it memory stays still, but soon as i click the second tab item it appears to start data binding.

Thanks for the help anybody!

+1  A: 

The WPF TabControl unloads the tabs that are not currently visible and reloads them when you switch to them. So changing from Tab1 to Tab2 is unloading Tab1 and loading Tab2 (This can be verified with a Loaded event on an item in the tabs).

Are you doing anything memory-intensive within your tabs or within the Loaded events of any tabcontrols?

Rachel
yes sir i am building a chart any suggestions?
TCoder
If your chart has a lot of rows/columns I'd recommend looking into Virtualizing it (google VirtualizingStackPanel) since that will cause only the rows that are visible to be created. If the slowness is caused by something such as a huge DataSet being populated then I'd recommend saving the dataset in the CodeBehind and binding the chart to it so that reloading the tab only reloads the binding, not the entire dataset.
Rachel