A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

34 lines
903 B

namespace Perspex.Xaml.DataBinding.ChangeTracking
{
using System;
using System.Reflection;
using Controls;
using Glass;
class TargettedProperty
{
private readonly object instance;
private readonly PropertyInfo propertyInfo;
public TargettedProperty(object instance, PropertyInfo propertyInfo)
{
Guard.ThrowIfNull(instance, nameof(instance));
Guard.ThrowIfNull(propertyInfo, nameof(propertyInfo));
this.instance = instance;
this.propertyInfo = propertyInfo;
}
public object Value
{
get { return propertyInfo.GetValue(instance); }
set
{
propertyInfo.SetValue(instance, value);
}
}
public Type PropertyType => propertyInfo.PropertyType;
public string Name => propertyInfo.Name;
}
}