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); }
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); }
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); }