IDataValidationPlugin.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. namespace Avalonia.Data.Core.Plugins
  3. {
  4. /// <summary>
  5. /// Defines how data validation is observed by an <see cref="ExpressionObserver"/>.
  6. /// </summary>
  7. public interface IDataValidationPlugin
  8. {
  9. /// <summary>
  10. /// Checks whether this plugin can handle data validation on the specified object.
  11. /// </summary>
  12. /// <param name="reference">A weak reference to the object.</param>
  13. /// <param name="memberName">The name of the member to validate.</param>
  14. /// <returns>True if the plugin can handle the object; otherwise false.</returns>
  15. bool Match(WeakReference<object> reference, string memberName);
  16. /// <summary>
  17. /// Starts monitoring the data validation state of a property on an object.
  18. /// </summary>
  19. /// <param name="reference">A weak reference to the object.</param>
  20. /// <param name="propertyName">The property name.</param>
  21. /// <param name="inner">The inner property accessor used to access the property.</param>
  22. /// <returns>
  23. /// An <see cref="IPropertyAccessor"/> interface through which future interactions with the
  24. /// property will be made.
  25. /// </returns>
  26. IPropertyAccessor Start(WeakReference<object> reference,
  27. string propertyName,
  28. IPropertyAccessor inner);
  29. }
  30. }