internal WeakErrorsChangedListener(INotifyDataErrorInfo notifyDataErrorInfo, bool notifyChild, IErrorsChangedListener errorsChangedListener)
 {
     this.notifyDataErrorInfo = notifyDataErrorInfo;
     this.notifyChild = notifyChild;
     notifyDataErrorInfo.ErrorsChanged += new EventHandler<DataErrorsChangedEventArgs>(this.ErrorsChangedCallback);
     this.weakErrorsChangedListener = new WeakReference(errorsChangedListener);
 }
Example #2
0
        private void ErrorsChangedCallback(object sender, DataErrorsChangedEventArgs args)
        {
            if (this.weakErrorsChangedListener == null)
            {
                return;
            }
            IErrorsChangedListener target = this.weakErrorsChangedListener.Target as IErrorsChangedListener;

            if (target == null)
            {
                this.Disconnect();
                return;
            }
            target.OnErrorsChanged(sender, this.notifyChild, args);
        }
Example #3
0
 internal WeakErrorsChangedListener(INotifyDataErrorInfo notifyDataErrorInfo, bool notifyChild, IErrorsChangedListener errorsChangedListener)
 {
     this.notifyDataErrorInfo           = notifyDataErrorInfo;
     this.notifyChild                   = notifyChild;
     notifyDataErrorInfo.ErrorsChanged += new EventHandler <DataErrorsChangedEventArgs>(this.ErrorsChangedCallback);
     this.weakErrorsChangedListener     = new WeakReference(errorsChangedListener);
 }