Class PropertyAccessorBase
Defines a default base implementation for a IPropertyAccessor.
public abstract class PropertyAccessorBase : IPropertyAccessor, IDisposable
- Inheritance
-
PropertyAccessorBase
- Implements
- Derived
- Inherited Members
Constructors
PropertyAccessorBase()
protected PropertyAccessorBase()
Properties
PropertyType
Gets the type of the property.
public abstract Type? PropertyType { get; }
Property Value
Exceptions
- InvalidOperationException
The accessor has not been subscribed to yet.
Value
Gets the current value of the property.
public abstract object? Value { get; }
Property Value
Methods
Dispose()
public void Dispose()
PublishValue(object?)
Publishes a value to the listener.
protected void PublishValue(object? value)
Parameters
value
objectThe value.
SetValue(object?, BindingPriority)
Sets the property value.
public abstract bool SetValue(object? value, BindingPriority priority)
Parameters
value
objectThe value to set. Guaranteed to be of a valid type for the property.
priority
BindingPriorityThe priority with which to set the value.
Returns
- bool
True if the property was set; false if the property could not be set.
Subscribe(Action<object?>)
Subscribes to the value of the member.
public void Subscribe(Action<object?> listener)
Parameters
SubscribeCore()
When overridden in a derived class, begins listening to the member.
protected abstract void SubscribeCore()
Unsubscribe()
Unsubscribes to the value of the member.
public void Unsubscribe()
UnsubscribeCore()
When overridden in a derived class, stops listening to the member.
protected abstract void UnsubscribeCore()