using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.ExceptionServices;
using Avalonia.Utilities;
namespace Avalonia.Data.Core.Plugins
{
///
/// Reads a property from a .
///
public class AvaloniaPropertyAccessorPlugin : IPropertyAccessorPlugin
{
///
[RequiresUnreferencedCode(TrimmingMessages.PropertyAccessorsRequiresUnreferencedCodeMessage)]
public bool Match(object obj, string propertyName)
{
if (obj is AvaloniaObject o)
{
return LookupProperty(o, propertyName) != null;
}
return false;
}
///
/// Starts monitoring the value of a property on an object.
///
/// A weak reference to the object.
/// The property name.
///
/// An interface through which future interactions with the
/// property will be made.
///
[RequiresUnreferencedCode(TrimmingMessages.PropertyAccessorsRequiresUnreferencedCodeMessage)]
public IPropertyAccessor? Start(WeakReference