MahApps/MahApps.Metro — pull request #1681 by punker76 (2014-11-28 18:41:11+00:00)
Title: fix FlyoutsControl memory leak and exception

Closes #1638 Update FlyoutsControl.cs
>i'm using a binded to an >ObservableCollection but when i remove items from Flyout Collection i get a Value can't be null >error.
>
>Following the recent conversation with thoemmi in Gitter i changed FlyoutControl to check for null before >advancing

this pr uses a nice solution from [this]( http://agsmith.wordpress.com/2008/04/07/propertydescriptor-addvaluechanged-alternative/)

>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.