OneTime bindings were failing in BindingTest because the initial binding
error was being counted as the single value to transfer. Don't do this
with OneTime bindings - only transfer valid values.
If a TextBox is e.g. bound to an int and the user types "02" then the
TextBox text should be "02" - not the value that comes back from the
binding which will be "2".
This speeds up the common path of no data validation: this way we don't
need to get the metadata unless a binding notification is received. This
means that if a binding with data validation is assigned to a property
that isn't interested then UpdateDataValidation will be called, but the
control should just ignore it.
This reverts commit 57e646583f.
For TextBox there can be 2 bindings to Text: one which is the binding to the
view model which should have data validation enabled, and another binding to
the TextPresenter in the template which should not have data validation
enabled, or it will override the view model data validation. For this we need
to be able to distinguish between the two and so bindings with data validation
enabled need to always send BindingNotifications.
Conflicts:
src/Avalonia.Base/AvaloniaObject.cs
tests/Avalonia.Markup.Xaml.UnitTests/Data/BindingTests_Validation.cs
We're going to say that for the moment only direct properties handle
data validation. This gets around a few thorny issues with data
validation on styled properties.
These are used to extensibly handle special values like `Task` and
`IObservable<>`. Previously this was baked into the expression observer
architecture with a TODO comment saying that it needs to be extensible.
And use it as base class for test data that implements
INotifyDataErrorInfo. Removed IndeiValidatorTests as its been
superceeded by IndeiValidationPluginTests.
When a virtualized list was scrolled to the bottom and then the list was
measured with a size larger than needed to fit all items (in this case
we use infinity) then the virtualizer tries to go backwards to add items
at the top of the currently visible items by setting `step = -1`;
however it didn't check whether the current index was < 0.
Fixes#589.
Don't add virtualized items before the virtualizing panel is attached to
the visual tree, as bindings etc won't be set and so measurement will
produce 0,0 causing all items to be materialized.