I'm experiencing some terrible performance with ViewModelBase (WPF) class. If changing Model properties or adding items to list, profiler is returning results that are hundreds of times slower then expected. I figured out that such performance is because of events attached in HookChangedEvents method?
Solution may be to implement some disposable class, eg. BypassChangedEvents wich will wrap UnhookChangedEvents, HookChangedEvents and OnSetProperties.
After that code that is changing Model may look like:
// Model.Property = something;
What events are you talking about? Custom events, or standard PropertyChanged events?
Standard PropertyChanged and ChildChanged events.
Copyright (c) Marimer LLC