C# (CSharp) MahApps.Metro.Controls PropertyChangeNotifier - 15 exemples trouvés. Ce sont les exemples réels les mieux notés de MahApps.Metro.Controls.PropertyChangeNotifier extraits de projets open source. Vous pouvez noter les exemples pour nous aider à en améliorer la qualité.
AddValueChanged of dependency property descriptor results in memory leak as you already know. So, as described here, you can create custom class PropertyChangeNotifier to listen to any dependency property changes. This class takes advantage of the fact that bindings use weak references to manage associations so the class will not root the object who property changes it is watching. It also uses a WeakReference to maintain a reference to the object whose property it is watching without rooting that object. In this way, you can maintain a collection of these objects so that you can unhook the property change later without worrying about that collection rooting the object whose values you are watching. Complete implementation can be found here: http://agsmith.wordpress.com/2008/04/07/propertydescriptor-addvaluechanged-alternative/