* Allow Dispatcher to be implicitly cast to TaskScheduler
* API change requests
* Cache one scheduler per priority
* Cache a TaskScheduler in each sync context
* Add word break support and use it for ellipsis
* Regenerate Unicode text-formatting data to v17 and fix issues
---------
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
Co-authored-by: Benedikt Stebner <Gillibald@users.noreply.github.com>
* Fix#20625: fix compiled binding DataContext inference in ItemTemplate
The Sandbox repro failed with AVLN2100/AVLN2000 when compiled
bindings were used with ItemTemplate and name-based DataContext
access.
Root causes:
- No fallback DataContext type was inferred for the root object when
x:DataType was absent.
- Name-scope lookup could capture stale DataContext metadata from an
unrelated traversal branch, causing #ListBoxRoot.DataContext to
incorrectly resolve to the item type.
Fixes:
- Add root-level DataContext fallback inference in
AvaloniaXamlIlDataContextTypeTransformer.
- Update ScopeRegistrationFinder to resolve DataContext from the
current ancestor stack when the matching name is found.
- Preserve first-match semantics and prefer root namescope lookup
before deferred scopes in name binding resolution.
- Add and expand unit tests for ItemTemplate and nested namescope
scenarios, including mismatched runtime DataContext behavior.
Signed-off-by: João Cruz <joaosantaremdacruz@tecnico.ulisboa.pt>
* Fix#20625: simplify compiled binding regression tests
Address review feedback to reduce test complexity in XamlIlTests.
This change removes per-test UserControl helper classes and command
scaffolding that were not required to validate the compiler behavior.
Tests now use inline XAML in each [Fact] and shared lightweight mock
types for root and item data.
The compiled binding scenarios are still covered, including root
fallback inference and named DataContext resolution with ItemTemplate
and nested namescopes, but with less boilerplate and better readability.
* Fix#20625: remove automatic DataContext fallback to root type
Address review feedback by removing the automatic fallback inference
to the root type in AvaloniaXamlIlDataContextTypeTransformer, as it
is not necessary to fix the issue and is not desired behavior.
Also removes the unit tests that validated this specific fallback.
---------
Signed-off-by: João Cruz <joaosantaremdacruz@tecnico.ulisboa.pt>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Make sure TryGetGlyphTypeface does not fail for concurrent access
* Update tests/Avalonia.Base.UnitTests/Media/FontManagerTests.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update gitignore
* Make TryGetFontCollection more robust and add unit tests
* Introdcue GetOrCreateFontCollection helper for safe disposal of losing instances
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* ensure system back event is passed to child page once
* fix formatting in DrawerPage
* add tests
* add back default page handler for system back event, but only check OnSystemBackButtonPressed
* removed `OnSystemBackButtonPressed` checks in derived page classes
* nav page - send back event to current page before modal pages.
* Fix modal-first system back routing in NavigationPage
---------
Co-authored-by: Javier Suárez Ruiz <javiersuarezruiz@hotmail.com>
Addresses path traversal vulnerability GHSA-6c8g-7p36-r338
(CVE in IArchive.WriteToDirectory) which affects all versions
<= 0.47.4. Version 0.48.0 is the first non-vulnerable release
per the NuGet vulnerability API.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Return null when an IPresentationSource can't convert from/to screen coordinates
Document exceptions in VisualExtensions PointToClient and PointToScreen
Add tests for cross-root pointer event positions
* Run Win32 file picker on a dedicated thread to avoid MTA deadlock
* Add threading comment in Win32StorageProvider
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Update HarfBuzzSharp and SkiaSharp package versions
https://github.com/mono/SkiaSharp/releases/tag/v3.119.4-preview.1.1
SkiaSharp v3.119.4-preview.1.1 has many features:
Add SkiaSharp.Views.Gtk4 using GirCore.Gtk-4.0 bindings
Add Linux Bionic native assets support, that can make high-performance Android application
Add PolySharp for C# 13 support on legacy TFMs
Add Tizen x64 and arm64 native build support
Delay-load D3D12 DLLs to prevent crashes on systems without DX12
Bump Skia milestone from 119 to 133
* Restore HarfBuzzSharp version
* Fix headless cleanup race: dispose before signalling TCS (#20664)
Restructure DispatchCore<TResult> so application.Dispose() runs in a
finally block before tcs.TrySet* is called. Previously, the using-var
scope closed after TrySetResult, leaving s_uiThread set when the next
non-headless test started.
Adds a regression test in IsolationTests that verifies Dispatcher.UIThread
is accessible from the calling thread immediately after a headless dispatch
completes (PerTest isolation only).
* Use Assert.SkipWhen in Dispatch_Cleanup_Should_Complete_Before_Task_Returns
* Restrict Dispatch_Cleanup_Should_Complete_Before_Task_Returns to NUnit
xUnit's AvaloniaFactDiscoverer wraps every [Fact] in session.Dispatch,
so awaiting another session.Dispatch inside the test body deadlocks on
the session's single background thread.
* Remove new test
It isn't reliable enough during CI.
---------
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
* mark ToplevelImpl._view as nullable.
* Update src/Android/Avalonia.Android/Platform/SkiaPlatform/TopLevelImpl.cs
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* return 1 as default scaling in android TopLevelImpl
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Truncate the content when writing
To maintain consistency with other operating system APIs, see: https://github.com/AvaloniaUI/Avalonia/pull/20804 & https://github.com/AvaloniaUI/Avalonia/pull/20807
* Prevent accidental truncation when creating files
* Update comments
* Validate existing item type when creating storage
* Truncate files on creation in storage items
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* fix safe area calcs for navigation page
* update nav bar effective height on safe area change
* reset nav bar height if visibility changes
* add tests