Handle changing a `Transitions` collections to new collection which contains some of the same elements.
Added a comment explaining why we add new transitions before replacing old transitions; was explained in the commit message for 0694b22c51.
When transitions are replaced, add the new transitions before removing the old transitions, so that when the old transition being disposed causes the value to change, there is a corresponding entry in `_transitionStates`.
Also search the `Transitions` collection from last to first to find a matching transition, so that later added transitions have priority.
Fixes#4059
This requires that a `<Transitions>` element is used to contain the transitions in XAML and a `new Transitions()` is used when assigning transitions from code.
`Visual` knows when it's attached to the visual tree, so it can enable transitions then.
This is a hack due to the fact that non-Visuals currently don't know when to enable transitions.
- Don't apply transitions before control is added to the visual tree
- Don't allow transitions on direct properties
- Ignore animated values when determining whether to trigger a transition
- Cancel transition when removed from `Transitions` collection
- 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>`