IPropertyAccessorPlugin.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright (c) The Avalonia Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using System;
  4. namespace Avalonia.Data.Core.Plugins
  5. {
  6. /// <summary>
  7. /// Defines how a member is read, written and observed by an
  8. /// <see cref="ExpressionObserver"/>.
  9. /// </summary>
  10. public interface IPropertyAccessorPlugin
  11. {
  12. /// <summary>
  13. /// Checks whether this plugin can handle accessing the properties of the specified object.
  14. /// </summary>
  15. /// <param name="obj">The object.</param>
  16. /// <param name="propertyName">The property name.</param>
  17. /// <returns>True if the plugin can handle the property on the object; otherwise false.</returns>
  18. bool Match(object obj, string propertyName);
  19. /// <summary>
  20. /// Starts monitoring the value of a property on an object.
  21. /// </summary>
  22. /// <param name="reference">A weak reference to the object.</param>
  23. /// <param name="propertyName">The property name.</param>
  24. /// <returns>
  25. /// An <see cref="IPropertyAccessor"/> interface through which future interactions with the
  26. /// property will be made.
  27. /// </returns>
  28. IPropertyAccessor Start(
  29. WeakReference reference,
  30. string propertyName);
  31. }
  32. }