* Add failing test for #16113.
* Convert delegate to ICommand in style setter.
When compiling a binding to e.g. `Button.Command` in a style `Setter`, we were not converting `XamlIlClrMethodPathElementNode` to `XamlIlClrMethodAsCommandPathElementNode` as we were only testing whether the property that the binding was being assigned to is an `ICommand`.
If we detect that we're assigning the binding to a `Setter.Value` then we need to look in the `Setter.Property` to see check whether the property is an `ICommand` too.
Fixes#16113
* Add tests for binding negation operator.
Expected results come from 11.0.x branch.
* Unset and null need to be distinct.
Also remove `ExpressionNode.Reset` as it was doing unneeded stuff and should just be the same as `SetSource(AvaloniaProperty.UnsetValue, null);`.
* Make ExpressionNode.OnSourceChanged accept null.
The previous design assumed that a source of `null` was an invalid input to all types of expression nodes. It turned out that there was a single exception to this rule: the `!` operator can in fact operate on a null value. With this new design we instead have to explicitly check for a null value in every override of `OnSourceChanged ` except in `LogicalNotNode`.
Due to this change, we also have to distinguish between `null` and `(unset)` in `ExpressionNode.SetSource` as well.
Fixes#16071
* Fix comment.
* Add failing KeySpline tests
* Fix Animator for progress values less than zero
---------
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
* Added failing test for #15201.
* Handle nested BindingNotifications.
When #13970 was written, [a check](https://github.com/AvaloniaUI/Avalonia/pull/13970/files#diff-cfb25a491b9452e1815aa2c0d71465aaf81e99792a88a04a1a2ed572fd1930ffR60) was added to ensure that nested `BindingNotification`s didn't happen, and the refactor was written with the assumption that they wouldn't happen.
The problem is that they _do_ happen: when a source object implements both `INotifyDataErrorInfo` and had data annotations, then the nested data validation plugins would each wrap the value coming from the previous plugin in a new `BindingNotification`, resulting in nested `BindingNotifications`.
This adds support for nested binding notifications back in - even though IMO nesting binding notifications is a bug, if we're doing it and we previously supported it then we should continue to support it.
Fixes#15201
* Added failing tests for #15081.
* Provide target property in BindingExpression ctor.
Usually it is not necessary to provide the target property when creating a `BindingExpression` because the property will be assigned when the binding expression is attached to the target in `BindingExpressionBase.Attach`.
This is however one case where `Attach` is not called: when the obsolete `binding.Initiate` method is called and then an observable is read from the `InstancedBinding` without the binding actually being attached to the target object. In this case, prior to the binding refactor in #13970 the value produced by the observable was still converted to the target type. After #13970, because the target property (and hence the target type) is not yet set, the conversion is to the target type is no longer done.
`DataGrid` uses this obsolete method when editing cells, causing #15081. Ideally we'd fix that in `DataGrid` but I'm not happy making this change so close to 11.1, so instead fix this use-case to behave as before.
Fixes#15081
* test: CommandParameter does not change between CanExecute and Execute
* feat: CommandParameter does not change between CanExecute and Execute
* test: update
* add isStroked overload for IGeometryContext
* move IGeometryContextEx
* fix Fill Path line
* remove added whitespaces
* close a figure to non-stroke lines with a line
* add geometry tests
* add wpf test files
* Added a test for tracking path closure with missing strokes for various line caps/joins
* add IsStroke overload for other segments
* update tests
* Skip line join test for closed geometry with holes for now
---------
Co-authored-by: Nikita Tsukanov <keks9n@gmail.com>
* use tap size as default size for scrolling start. reset IsGestureRecognitionSkipped when pointer is released
* use static default constant for scroll distance
* fix typo
* Fix native menu bar tooltip
* Make ToolTip tests more reliable
* Increase MacOS_Native_Menu_Has_ToolTip_If_Defined sleep delay
* Disable MacOS_Native_Menu_Has_ToolTip_If_Defined, as it fails way too often
* Reduce allocations in XamlIlRuntimeHelpers
* Iterate XAML parents without allocations
* Use IDeferredContent for XAML deferred content to reduce allocations
* Use function pointer in DeferredTransformationFactory
* Reuse parent resource nodes if possible for deferred content
* Fix function pointer usage with SRE
Make `SelectionModel.SelectedItems` and `SelectionModel.SelectedIndexes` implement `INotifyCollectionChanged` so that they can be bound to.
As well as implementing `INotifyCollectionChanged` on the collections, we also had to implement `IList` (see #8764) so refactored this out into a base class.
For the sake of simplicity, these collections only raise `Reset` for any change: this is may need to be changed later but I'd rather follow the KISS principle for the moment until something more complex is proven necessary.
Fixes#15497
* Add more tests for ScrollIntoView.
* Improve ScrollIntoView.
Take into account the element we're scrolling to when calculating the anchor element for realization.
* Use 2.88.8-preview.1.1 skiasharp
* Use SKImageFilter directly, as we don't need compat anymore
* Add SkiaSharp 3 render tests
* Enable SkiaSharp 3 tests on CI
* Add IncludeLinuxSkia in Skia tests
* Update Skia version, remove SkiaCompat
* Remove Skia3 test project, reuse single Skia render test project, so they won't conflict
* Don't call dispatcher shutdown, when app shutdown was cancelled
* Assert Dispatcher.UIThread.ShutdownStarted in TryShutdown_Cancellable_By_Preventing_Window_Close
* Add FuncValueConverter with parameter support
* Fix summary comment
* Fix summary comment
* Add Equal and NotEqual converters to a ObjectConverters class
* Fix condition for Equal
* Added ObjectConverters unit tests
* Added failing test for #14753.
* Don't try to publish on non-running binding.
This can happen in cases like #14653 where:
1. An event is raised with 2 binding expression subscribers
2. The first subscriber causes the 2nd subscriber to be stopped
3. The second subscriber is called from the event, even though it has been stopped (as the event list was cached at step 1)
4. It calls `PublishValue` causing an exception
Easiest to just do nothing in `PublishValue` when this scenario happens.
* Add Points binding observability support for Polygon and Polyline
* Add simple tests for Polygon and Polyline Points updating
* Revert "Add Points binding observability support for Polygon and Polyline"
This reverts commit e16d987945.
* Move Geometry.Changed handler to Shape class to make it available to all inheritors
* Fixes the event subscriptions
* Fix tests
* Add memory leak tests
* Don't create a layer if the previous frame is retained by the render target
* D2D
* compile
* Only check PreviousFrameIsRetained if not using layer
* ABI