IDirectPropertyAccessor.cs 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. // Copyright (c) The Perspex Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. namespace Perspex
  4. {
  5. /// <summary>
  6. /// Provides a runtime interface for getting and setting
  7. /// <see cref="DirectProperty{TOwner, TValue}"/> values.
  8. /// </summary>
  9. internal interface IDirectPropertyAccessor
  10. {
  11. /// <summary>
  12. /// Gets a value indicating whether the property is read-only.
  13. /// </summary>
  14. bool IsReadOnly { get; }
  15. /// <summary>
  16. /// Gets the value of the property on the instance.
  17. /// </summary>
  18. /// <param name="instance">The instance.</param>
  19. /// <returns>The property value.</returns>
  20. object GetValue(IPerspexObject instance);
  21. /// <summary>
  22. /// Sets the value of the property on the instance.
  23. /// </summary>
  24. /// <param name="instance">The instance.</param>
  25. /// <param name="value">The value.</param>
  26. void SetValue(IPerspexObject instance, object value);
  27. }
  28. }