Ejemplo n.º 1
0
 private void ConsumeNotifyDataErrorInfo(string propertyName, INotifyDataErrorInfo notifyDataErrorInfo, INotifyDataErrorInfo notifyChildDataErrorInfo)
 {
     if (notifyDataErrorInfo != null && this.binding.Mode != BindingMode.OneTime)
     {
         this.errorsChangedListener = new WeakErrorsChangedListener(notifyDataErrorInfo, false, this);
     }
     if (notifyChildDataErrorInfo != null && this.binding.Mode != BindingMode.OneTime)
     {
         this.childErrorsChangedListener = new WeakErrorsChangedListener(notifyChildDataErrorInfo, true, this);
     }
     if (notifyDataErrorInfo != null)
     {
         this.NotifyNewDataErrorInfos(propertyName, notifyDataErrorInfo, false);
     }
     if (notifyChildDataErrorInfo != null)
     {
         this.NotifyNewDataErrorInfos(string.Empty, notifyChildDataErrorInfo, true);
     }
 }
Ejemplo n.º 2
0
 private void ResetNotifyDataErrorInfo(bool resetCurrentNotifyDataErrorInfo, bool resetCurrentNotifyChildDataErrorInfo)
 {
     if (resetCurrentNotifyDataErrorInfo & this.currentNotifyDataErrorInfo != null)
     {
         if (this.errorsChangedListener != null)
         {
             this.errorsChangedListener.Disconnect();
             this.errorsChangedListener = null;
         }
         this.currentNotifyDataErrorInfo = null;
     }
     if (resetCurrentNotifyChildDataErrorInfo && this.currentNotifyChildDataErrorInfo != null)
     {
         if (this.childErrorsChangedListener != null)
         {
             this.childErrorsChangedListener.Disconnect();
             this.childErrorsChangedListener = null;
         }
         this.currentNotifyChildDataErrorInfo = null;
     }
     if (resetCurrentNotifyDataErrorInfo)
     {
         this.NotifyOldDataErrorInfos(false);
     }
     if (resetCurrentNotifyChildDataErrorInfo)
     {
         this.NotifyOldDataErrorInfos(true);
     }
 }