/// <summary>
 /// Stop listening for the dependency property changed.
 /// </summary>
 public void Detach()
 {
     if (_relayObject != null)
     {
         CompatUtility.ExecuteOnUIThread(() =>
         {
             if (_relayObject != null)
             {
                 _relayObject.Dispose();
                 _relayObject = null;
             }
         }, _relayObject.Dispatcher);
     }
 }
 /// <summary>
 /// Initializes a new instances of the DependencyPropertyChangedListener class.
 /// </summary>
 /// <param name="instance">Instance subscribing to the property changed event.</param>
 /// <param name="dependencyObject">Source of the propertyChanged</param>
 /// <param name="propertyName">Dependency property name</param>
 public DependencyPropertyChangedListener(TInstance instance, DependencyObject dependencyObject, string propertyName)
 {
     _relayObject  = new RelayObject(dependencyObject, propertyName, OnPropertyChanged);
     _weakInstance = new WeakReference(instance);
 }