Steven Kirk
3e2d0a5ec0
Use consistent wording for binding warnings.
"Could not convert" instead of "Cannot convert".
3 years ago
Steven Kirk
00a619fe22
Log errors for failed conversions.
3 years ago
Steven Kirk
6bb9f92446
Log errors from property accessors.
3 years ago
Steven Kirk
036048c9f2
Move logging to BindingExpression.
As `BindingExpression` now has enough information to decide when it's appropriate to log an error/warning or not.
Fixes #5762
Fixes #9422
3 years ago
Steven Kirk
fb7f8a6d98
Initial refactor of binding infrastructure.
- `ExpressionObserver` has been removed and its functionality merged with `BindingExpression`
- `BindingExpression` handles all types of `BindingMode` itself; doesn't require `BindingOperations.Apply` to set up a separate observable for `TwoWay/`OneWayToSource` bindings
- This allows us to fix some long-standing issues with `OneWayToSource` bindings
- Expression nodes have been refactored
- No longer split between `Avalonia.Base` and `Avalonia.Markup`
- Categorize them according to whether they use reflection or not
A few tests are failing around binding warnings: this is because the next step here is to fix binding warnings.
3 years ago
Steven Kirk
c83e64d4d9
Fix spelling mistake.
3 years ago
Steven Kirk
7788a29a96
Make BindingExpression and ExpressionObserver internal.
4 years ago
Max Katz
59d7874b1d
Replace System.Reactive with internal extensions
4 years ago
Max Katz
526d9d052b
Avalonia.Base and controls related project trimming attributes
4 years ago
Steven Kirk
76667dbd0d
Finished adding nullable annotations to Avalonia.Base.
5 years ago
Steven Kirk
0bda763518
Added nullable annotations to Avalonia.Data. ( #7105 )
* Added nullable annotations to Avalonia.Data.
* ExpressionObserver root can be null.
5 years ago
Steven Kirk
479d480ad9
Parameterize logger on area as well as level.
So we can filter our more logging calls early.
6 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.
7 years ago
José Pedro
1ba4c68a35
Implemented TargetNullValue for bindings.
7 years ago
Dariusz Komosinski
5814bd7163
Remove direct logging functions.
7 years ago
José Pedro
433c70a6c8
Added BindingOperations.DoNothing.
Added tests.
7 years ago
José Pedro
fa8d8c896d
Removed redundant bool comparisons.
8 years ago
Steven Kirk
365aa42b4a
Use custom rx for binding update signal.
8 years ago
Steven Kirk
a3dea23560
Use LightweightObservableBase for BindingExpression.
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
78bb593f97
Use CurrentCulture instead of CurrentUICulture.
Use `CurrentCulture` instead of `CurrentUICulture` in converters etc. `CurrentUICulture` should be used for translations, `CurrentCulture` should be used for things like numbers, dates etc.
9 years ago
Steven Kirk
079d481e36
Renamed ExpressionSubject -> BindingExpression.
`ExpressionSubject` wasn't a good name as the important thing it isn't
convert an `ExpressionObserver` into an `ISubject`. The important thing
it does is insert an `IValueConverter` into the pipeline.
10 years ago
Steven Kirk
c9d3408c29
Improve numerical binding error messages.
10 years ago
Steven Kirk
a560c3b6d3
Use WeakReference in BindingNotification.
So that it doesn't keep objects alive when cached by
`.Publish().RefCount()` in `ExpressionObserver`. Added a leak test to
test that.
10 years ago
Steven Kirk
74e870333b
Correctly convert BindingNotifications.
In ExpressionSubject.
10 years ago
Steven Kirk
f4c57b169b
Handle BindingNotifications in ExpressionSubject.
10 years ago
Steven Kirk
daff817ce4
Subscribe to ExpressionSubject before setting value.
The inner `ExpressionObserver` must be subscribed to as setting the
value requires the expression to be evaluated.
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
0b28e10f21
Make broken DataContext bindings produce null.
This prevents incorrect DataContexts cascading down to children when the
DataContext binding is invalid, e.g. when things are being set up.
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
ee486113e5
Finished wiring up validation support. Now exceptions and INotifyDataErrorInfo implementers will set controls into their ":invalid" pseudo-class state.
11 years ago
Steven Kirk
6a5208621e
Return BindingError from property plugins.
11 years ago
Steven Kirk
3865198be4
Use Logger.Error instead of .Log.
11 years ago
Steven Kirk
886fbb5458
Make ExpressionObserver accept a priority for sets.
This makes auto-expanding the treeview in DevTools work again.
11 years ago
Steven Kirk
ffbd694bf7
Implemented Binding.FallbackValue.
Closes #238 .
11 years ago
Steven Kirk
67835cc09b
Applied a bunch of resharper suggestions.
11 years ago
Steven Kirk
b9992c582c
Added binding ConverterParameter.
Closes #317 .
11 years ago
Steven Kirk
7734f2bb52
Fix assorted bugs.
11 years ago
Steven Kirk
e301e56a9d
Start making Converters work.
When passed to Binding. Found another problem with OmniXAML which means
we can't continue along this road: OmniXAML issue #50 .
11 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.
11 years ago
Steven Kirk
16825ac45e
Handle null and UnsetValue in ExpressionSubject.
11 years ago
Steven Kirk
62b8c5a40c
Added default type converter for bindings.
To convert between basic types. Closes #256 . Closes #270 .
11 years ago
Steven Kirk
43a66901fc
Remove ExpressionValue.
Use PerspexProperty.UnsetValue instead.
11 years ago
Steven Kirk
14ca308900
Log binding path.
11 years ago
Steven Kirk
907505f194
Get simple two-way bindings working.
11 years ago
Steven Kirk
82be7441ad
Added ExpressionSubject.
11 years ago