Giuseppe Lippolis
4845c10d88
fix(ExpressionNode): ensure _subscriber do not change during ValueChanged
4 years ago
Steven Kirk
76667dbd0d
Finished adding nullable annotations to Avalonia.Base.
4 years ago
Steven Kirk
0bda763518
Added nullable annotations to Avalonia.Data. ( #7105 )
* Added nullable annotations to Avalonia.Data.
* ExpressionObserver root can be null.
4 years ago
Steven Kirk
4d01dacd77
Remove copyright headers.
Some of our files had them, some didn't. They serve no purpose legally so best to remove the ceremony.
6 years ago
Steven Kirk
d3f8d08a47
Make sure OneTime bindings unsubscribe.
`OneTime` bindings unsubscribe when the first value is pushed, meaning that they unsubscribe _during_ `ExpressionNode.StartListeningCore`. Make sure we handle this by:
- Setting `_listening = true` before calling `StartListeningCore`
- Subscribe to current value in `InpcPropertyAccessorPlugin` before sending current value, because we're unsubscribed when `SendCurrentValue` exits
6 years ago
Dariusz Komosiński
9acf82d47b
!B Fix expression nodes not knowing if last value is actually null or dead.
6 years ago
Dariusz Komosinski
868b5ea840
Update WeakReference usages to use the generic one.
7 years ago
Jeremy Koritzinsky
44bf2ee721
Add unit test and fix #2149 .
7 years ago
Andrey Kunchev
458d45bb49
fix problem in complex binging chain, when a null value in chain reset current value to all subsequent expression nodes, so next change is starting on clean
7 years ago
Steven Kirk
0c078c9dec
Don't use rx for ExpressionNodes.
`ExpressionNode`s were always single-subscriber and making them use `IObservable<>` meant that we had to have extra allocations in order to return `IDisposable`s. Instead of using `IObservable` use a simpler `Subscribe`/`Unsubscribe` pattern. This saves a bunch more memory.
8 years ago
Jeremy Koritzinsky
af186e3529
Move string-based binding paths up to Avalonia.Markup. Make the LINQ Expression paths and raw ExpressionNodes (now public) the primarily supported syntax.
8 years ago
Jeremy Koritzinsky
1c3b714a0e
Move fix up to SettableNode and ExpressionNode so all settable node types (i.e. PropertyAccessor and Indexer nodes) can get the fix.
8 years ago
Jeremy Koritzinsky
cf8244b37a
Move current contents of Avalonia.Markup to Avalonia.Base. Move Avalonia.Markup.Xaml.Data/Parser classes to Avalonia.Markup since they're not Xaml-specific.
Use pattern-matching switch.
Fix bug from cleanup.
8 years ago
Steven Kirk
f4f0597dca
Update next node in binding chain on error.
Fixes #831 and makes `Pushing_Null_To_RootObservable_Updates_Leaf_Node`
test pass.
9 years ago
Steven Kirk
715149b1f5
Improve stream operator error message.
When a stream operator is applied to an unsupported type.
9 years ago
Steven Kirk
0ddf4caa95
Added a "stream" binding expression operator.
Which is now required when wanting to get the value produced by a
Task/IObservable rather than the Task/IObservable itself. Fixes #711 .
9 years ago
Steven Kirk
c2a14f9db7
Swapped names in ExpressionNode.
Swapped names of StartListening and StartListeningCore - method names
ending with Core should be the subclass implementation.
10 years ago
Steven Kirk
7cb001801a
Try to improve logged binding errors.
- Don't log an error when the target for the root ExpressionNode is
null. This is usually because the `DataContext` hasn't been set up yet
and it spewed a load of useless error messages.
- Add a Description field to `ExpressionObserver` that can be used in
the case of e.g. #control bindings to record the whole expression (with
the "#control" part) rather than just the part tracked by the
`ExpressionObserver`.
10 years ago
Steven Kirk
f59c16bc00
Improve broken binding diagnostic messages.
10 years ago
Steven Kirk
0c2057e458
Fix failing tests, add other tests.
Also use logical parent's DataContext as base for DataContext bindings
instead of visual parent's. Was previously in error.
10 years ago
Steven Kirk
c5c60c483a
Add concept of "value plugins".
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.
10 years ago
Steven Kirk
2f72295657
Started refactor of ExpressionObserver.
Tying to be more "rx", but also will allow us to move forward on BindingNotification changes.
10 years ago
Steven Kirk
4906a472b0
Reimplemented data validation using BindingNotifications.
10 years ago
Steven Kirk
abdbcac79d
Added BindingNotification.
This will replace BindingError and IValidationStatus for bindings that want to notify binding/validation errors. Still WIP.
10 years ago
Steven Kirk
5c33fbc6ee
Reimplemented property validation.
As far as it was in `property-validation-grokys` branch. Things were
messed up on master so had to merge this manually so may be problems.
10 years ago
Steven Kirk
5be41985c3
Renamed Perspex -> Avalonia
10 years ago
Jeremy Koritzinsky
287cc3c22e
Fixes failing tests for when an ExpressionSubject/ExpressionObserver is never subscribed to.
10 years ago
Jeremy Koritzinsky
aab4331a52
Changed validation on controls to allow notifications from multiple types of validation and correctly report if it is valid. Changed initalization of validation plugins to nest within each other so there can be multiple active at once.
10 years ago
Jeremy Koritzinsky
ee486113e5
Finished wiring up validation support. Now exceptions and INotifyDataErrorInfo implementers will set controls into their ":invalid" pseudo-class state.
10 years ago
Steven Kirk
886fbb5458
Make ExpressionObserver accept a priority for sets.
This makes auto-expanding the treeview in DevTools work again.
10 years ago
Steven Kirk
3d271cd020
Started implementing weak bindings.
Tests currently failing as WeakSubscriptionManager doesn't support
unsubscribing yet.
10 years ago
Steven Kirk
67835cc09b
Applied a bunch of resharper suggestions.
10 years ago
Steven Kirk
7734f2bb52
Fix assorted bugs.
10 years ago
Steven Kirk
b230c3b3f3
Renamed XamlBinding -> Binding
Had to also rename enclosing namespace from Binding to Data as classes
with same name as a namespace cause problems.
10 years ago
Steven Kirk
43a66901fc
Remove ExpressionValue.
Use PerspexProperty.UnsetValue instead.
10 years ago
Steven Kirk
d43a79fab5
Wrote binding expression parser by hand.
Sprache couldn't cope with it as it requires a left-recursive grammar.
11 years ago
Steven Kirk
0f5af3db63
Use Sprache for parsing expressions.
Use sprache instead of Roslyn for parsing expressions. One test still failing.
11 years ago
Steven Kirk
e3b6ce4186
Add support for indexers in binding expressions.
11 years ago
Steven Kirk
774a9c0911
Implemented binding negation.
11 years ago
Steven Kirk
962c1ea01b
Pass SetValue through expression chain.
11 years ago
Steven Kirk
772937ad15
Change ExpressionValue to struct.
And add some docs.
11 years ago
Steven Kirk
cf3834755d
More ExpressionObserver tests.
11 years ago
Steven Kirk
005cd231cc
Initial implementation of ExpressionObserver.
11 years ago