C# (CSharp) MahApps.Metro.Controls PropertyChangeNotifier - 15 examples found. These are the top rated real world C# (CSharp) examples of MahApps.Metro.Controls.PropertyChangeNotifier extracted from open source projects. You can rate examples to help us improve the quality of examples.
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/