/// <summary>
 /// Handles collection changed events raised by the source
 /// </summary>
 /// <param name="sender">The source collection</param>
 /// <param name="e">The event args</param>
 private void SourceCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     if (this._weakListener != null)
     {
         ICollectionChangedListener target = this._weakListener.Target as ICollectionChangedListener;
         if (target != null)
         {
             target.OnCollectionChanged(sender, e);
         }
         else
         {
             this.Disconnect();
         }
     }
 }
예제 #2
0
        private void SourceCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (this.weakListener == null)
            {
                return;
            }
            ICollectionChangedListener target = this.weakListener.Target as ICollectionChangedListener;

            if (target == null)
            {
                this.Disconnect();
                return;
            }
            target.OnCollectionChanged(sender, e);
        }