- animation/layout/render cycle is now managed from a central location
- animations are now throttled if animation/layout/render pass takes longer than a frame which previously caused a soft-freeze with input not being processed
- the public API is trimmed to make sure that we can make other planned changes during the 11.x support cycle
"Changelog":
- IClock is hidden and is planned to be replaced later
- Animator classes are hidden and are planned to be refactored later
- IAnimation members are hidden, it's supposed to be a marker interface for Style.Animations collection now, to start animations manually use Animation.RunAsync
- Sealed several classes in Avalonia.Animation namespace
- Spring class is removed from the public API (it wasn't possible to use it directly in a meaningful way anyway)
- Sealed brushes, transforms, effects and drawings
- Removed separate dispatcher priorities for Layout and Composition, everything now happens from a central place with Render priority (same as WPF)
- - some private "hook" priorities are added for now, those will be removed later
- IRenderLoop is hidden and removed from locator
- IRenderer is hidden (the plan is to remove that concept later)
- - Renderer.Start/Stop exposed as StartRendering/StopRendering on the toplevel (will be on a CompositionTarget/PresentationSource-like type later)
- - Renderer.Diagnistics exposed as RendererDiagnostics (same)
- - Renderer is no longer created by the platform code and is created by TopLevel itself
- - From the user-code hit-testing should be done by VisualExtensions.GetVisual(s)At, which has the same features
- - For unit tests a separate IHitTester interface is added which can be changed for a particular toplevel
- ILayoutManager is hidden
- - LayoutManager.ExecuteLayoutPass() exposed as TopLevel.UpdateLayout()
- Custom animators now have a separate base class that only deals with interpolation
Minor improvements:
- Compositor has a mode that doesn't use DispatcherTimers, useful for unit tests
- Introduced ScopedTestBase that auto-resets the locator when test is finished
The API for `ScrollChangedEventArgs` is different to WPF's here, because:
- Avalonia's `ScrollViewer` exposes `Extent`, `Offset` and `Viewport` as `Size`/`Vector` structs whereas WPF exposes separate `double` values for the X and Y components for each of these
- The current values are not included in the event args: then can easily be read from the `sender`
- UWP doesn't expose these values at all
For non-logical scrolling:
- Use 16 for small scroll size (value taken from WPF)
- Use viewport size for large scroll
For logical scrolling, use the `ScrollSize`/`PageScrollSize` defined on `ILogicalScrollable`. Note that this required a small breaking change to `ILogicalScrollable`.
Fixed#3245
...during ApplyTemplate. This was so that ItemsControls could their find
ItemsPresenters nested in other templated controls. Instead use
IItemsPresenterHost to make the presenter register itself with its
TemplatedParent.
Usually controls are only registered with their name scope when they get
added to a rooted visual tree, but this causes problems for tests, and
would mean the templated control wouldn't work if the client called
ApplyTemplate themselves before the control is added to the visual tree.
Work around this by explicitly registering template controls with the
name scope when the template is applied.
To allow this, we need to allow controls to be registered with a name
scope multiple times.
Some tests still failing as controls are only registered with name scope
when attached to a rooted visual tree. Need to work around this by
explicitly registering controls when applying template.
Currently works so far as to scroll an image in the Images tab of the
test app. Hiding the scrollbars is currently disabled as it requires a
layout pass to be triggered during a layout pass. Need to work out a
way around that...