-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a runtime switch option to disable ValueChangedEventManager #10148
Comments
All WPF developers know that if you care about performance and bind to something that you know doesn't change, you should use OneTime binding mode. By not doing so, you are literally telling WPF to do whatever it can to keep up with the changes. Type descriptors are well documented .NET mechanism and WPF intentionally supports them, see e.g. Binding Sources Overview or Optimizing Performance: Data Binding. If I rely on it in a library, I wouldn't want someone using my library to break it by disabling it in their application. |
This only works for the simplest of cases. If we have a chained path where everything in it supports INotifyPropertyChanged, but the last few properties, we cannot do it. Also I don't want to break the binding to such properties. I want to disable the framework to helplessly try to subscribe for changes in such cases. |
I would say, it is not only about performance but also about leaking memory. I would agree that it would be nice, if the behavior can be controlled in some way. |
A chained path is a good point that is not easily covered by binding mode. A memory leak is a different issue. If there is a memory leak, then we should fix the memory leak. |
When binding to objects which do not implement
INotifyPropertyChanged
interface, the underlying data binding engine will use an obscure mechanism to try and listen to changes in any .NET object - ValueChangedEventManager.Please, add a switch which disables this functionality. All WPF developers know that if we want change notifications, we should implement
INotifyPropertyChanged
.This will improve the overwall WPF data binding performance, because there are a lot of cases where we need to databind to something (e.g. Length property of an array) which doesn't implement INotifyPropertyChanged.
The text was updated successfully, but these errors were encountered: