Interface IReadOnlyPropertyPath
Represents an interface for the runtime property chain path with read-only access.
public interface IReadOnlyPropertyPath
- Extension Methods
Properties
PropertyType
Gets the type of the last property in the chain.
Type PropertyType { get; }
Property Value
Methods
DependsOn(string)
Determines whether a change of the specified property on the source object can change this path's value.
bool DependsOn(string propertyName)
Parameters
propertyNamestringThe name of the changed property, as reported by INotifyPropertyChanged.
Returns
- bool
true if the path starts with the specified property, or if it can't tell; otherwise, false. The default implementation always returns true.
Remarks
A Binding uses this to ignore change notifications for unrelated properties of its source, so they don't overwrite the text a user is typing.
GetPropertyType(object)
Gets the type of the last property in the chain, resolved against the specified source object.
Type GetPropertyType(object source)
Parameters
sourceobjectAn object the path starts from.
Returns
- Type
The declared type of the last property in the chain. The default implementation returns PropertyType.
Remarks
Paths that only learn their types at runtime, such as DynamicPropertyPath, override this method to report the real property type, so a Binding can convert typed text into it.
GetValue(object)
Gets the value by calling the property chain for the specified source object.
object? GetValue(object source)
Parameters
sourceobjectAn object to retrieve value from.
Returns
- object
The value by the specified property path.