For non-attached properties these will be the same. For attached properties the metadata needs to be registered on the host, but the `Owner` property needs to be set to the owner, not the host.
This method is used to strip coercion methods out of StyledPropertyMetadata when applying it to a new owner.
Also fixed AvaloniaProperty.(IPropertyInfo.CanSet) returning true for read-only properties
We already have a place to store them in the `_localValueBindings` list, so use that rather than having a separate `_directBindings` list in `AvaloniaObject`.
It was only used internally in creating `ISetterInstance`s so add a virtual method to `AvaloniaProperty` to do this explicitly without generic virtual methods.
- Pass information for all property changes to `OnPropertyChangedCore`; whether they result in an effective value change or not
- Added `GetBaseValue` to get a value with a specified priority
- Change the signature of `OnPropertyChanged` again to take an `AvaloniaPropertyChangedEventArgs<T>`
We already have some specific internal methods for routing certain methods via an untyped property to a typed property, but adding support for the visitor pattern allows us to support arbitrary use-cases.
It was only needed for pseudoclasses. Move pseudoclass registration to an engine that doesn't require `AvaloniaProperty.Initialized`, implemented in `PseudoclassEngine`.
This is needed so that things like the following can be done:
<TreeView>
<TreeView.Styles>
<Style Selector="TreeViewItem">
<Setter Property="IsExpanded" Value="{Binding IsExpanded}"/>
</Style>
</TreeView.Styles>
<TreeView>
(At the moment we have TreeDataTemplate.IsExpanded but this isn't good
enough: it only supports setting IsExpanded on creation of the item with
no binding.)
With this commit, setters can now contain bindings, but they aren't yet
applied correctly. As part of this commit, classes related to binding
have been moved to the Perspex.Data namespace.