`PropertyChanged` is not being fired when binding is disposed. Also change some other unit tests to ensure that priority passed in event args is correct.
It was only needed for pseudoclasses. Move pseudoclass registration to an engine that doesn't require `AvaloniaProperty.Initialized`, implemented in `PseudoclassEngine`.
Instead of using `Observable.ObserveOn` in bindings, interface with `Dispatcher.UIThread` to schedule binding notifications on the UI thread. This saves a significant amount of memory.
To do this needed to change behavior a little in that now binding errors update the target. Previously in the case of a binding error at the first node in the binding chain, we were converting the `BindingNotification` to `UnsetValue` which had the effect of updating the target value. Now we're passing the `BindingNotification` back, we need to make sure this happens. I believe this is the right thing to do as the behavior should be the same no matter where in the binding chain the error occurs. Data validation errors continue to not update the target.
1. Fixed some tests to expect `BindingNotification`s to be returned on a broken binding chain.
2. Changed logging of `BindingNotification`s - log at `Warning` level (instead of `Error`) except when the binding chain is broken at the root, in which case log at `Information` level. Do this to prevent flooding the output window when initializing.
From Avalonia.Base.UnitTests to Avalonia.LeakTests - the test was
failing on mono on OSX and I can't work out why. Leak tests don't
currently get run on mono CI.
When a direct property is set to UnsetValue, previously it used
default(TValue). Allow that value to be overridden and make it be -1 for
SelectingItemsControl.SelectedIndex.
When a direct property is set to UnsetValue, previously it used
default(TValue). Allow that value to be overridden and make it be -1 for
SelectingItemsControl.SelectedIndex.
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.