I'm developing a WPF application that heavily relies on DataBinding.
Basically the app has several tabsheets each of which have ~50 elements using DataBinding to my ViewModel. Some of the binding are a bit complex with datatriggers and converters to display images based on binding results and so on.
Performance is good when I start the application, but as I navigate each of the tabsheets its getting slower and slower (and CPU usage increase). After I've navigate, lets say, 10 tabs, the application is almost unusuable, hanging for a couple of seconds everytime the binding sources fires de PropertyChanged events.
It seems as if binding targeted to visual elements that are not visible (because they are in a different tabsheet than the current one) are still processing, running the converter, and updating the visual control.
Is there any way to disable this? It would be an option to implement my own TabControl that disables every binding for non visible tabs, but havent found how to do this yet.
Any other suggestion would be appreciated!
As a side note, that may be important: every binding source raises its own PropertyChanged every ~5s that is the time we are reading the values from a device in the viewmodel. So, every 5s or so around 300 objects that implements INotifyPropertyChanged raise simultaneously the PropertyChanged event and at this instant is when the application freezes for a couple of seconds.
Due to the nature of the application, is not a option to slow down the update to anything more than 5s.