* 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
* Fix#20816: OneWay binding fails to update target after local change
When a OneWay binding target is modified locally (e.g., via user
interaction on a ToggleButton), subsequent PropertyChanged events from
the source were being ignored. This occurred because the binding
expression incorrectly suppressed the update.
This patch modifies UntypedBindingExpressionBase to ensure that OneWay
bindings always propagate changes from the source to the target,
overriding any previous local changes. Unit tests were also added to
prevent future regressions on this behavior.
Signed-off-by: Martim Claudino <martimffclaudino@tecnico.ulisboa.pt>
* fix: scope forceUpdate to OneWay mode, use SetCurrentValue in tests and clean usings
Signed-off-by: Martim Claudino <martimffclaudino@tecnico.ulisboa.pt>
---------
Signed-off-by: Martim Claudino <martimffclaudino@tecnico.ulisboa.pt>
* fix: focus correct date selector for day-first locales in DatePickerPresenter
SetInitialFocus had a copy-paste bug where the day-first branch
focused _monthSelector instead of _daySelector. This caused every
locale that puts day first (UK, Europe, Australia, India — dd/MM/yyyy)
to focus the wrong selector when the picker opened.
Refactored the three near-identical if/else branches into a
data-driven loop that pairs each host panel with its selector,
making this class of copy-paste bug structurally impossible.
* chore: retrigger CI
* chore: retrigger CI
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* fix: check format key in DataTransferItem.FindAccessor single-item path
The single-item fast path in FindAccessor returned the stored value for
any format query without checking if the requested format matched.
This caused TryGetRaw to return wrong data when queried with a format
different from the one stored (e.g., querying Bitmap on a text-only item
returned the text value instead of null).
Add the missing singleItem.Key.Equals(format) check, consistent with
the dictionary path (TryGetValue) and RemoveCore.
* chore: retrigger CI
* chore: retrigger CI
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* test: add DataFormat.CreateInProcessFormat tests
Cover the new InProcess format API: kind, identifier, null/empty
validation, non-ASCII identifiers, HasSystemName for all four kinds,
ToSystemName throwing, equality/inequality, DataTransferItem
integration, and coexistence with other formats in DataTransfer.
* feat: implement DataFormat.CreateInProcessFormat<T> for in-process drag/drop
Add DataFormatKind.InProcess and DataFormat.CreateInProcessFormat<T>()
so users can pass arbitrary object references during in-process
drag-and-drop without crossing serialization boundaries.
- Add HasSystemName property to indicate whether ToSystemName() is valid
- Update ToSystemName to throw for InProcess (same as Universal)
- Guard all 7 platform backends (Win32, macOS, X11, Android, Browser,
iOS) to skip InProcess formats during clipboard/drag-drop enumeration
Closes#20097
* fix: remove HasSystemName API per review feedback
* test: add regression test for access key with system key events
Regression test for #20961: verifies that access keys fire correctly
when triggered via Alt+key (system key events).
* fix: provide KeySymbol for system key events via MapVirtualKey
On Windows, WM_SYSKEYDOWN (Alt+key) intentionally skips ToUnicodeEx
to avoid corrupting keyboard state. This left KeySymbol null, which
broke access keys after #20662 switched from Key to KeySymbol.
Use MapVirtualKey(VK, MAPVK_VK_TO_CHAR) as a layout-aware fallback
for system key events — it resolves the character without touching
keyboard state.
Fixes#20961
* chore: retrigger CI
* wip touch improvement textbox
* update text selection handle style
* change text selector layer z-index
* fix build issues
* fix caret detection in touch mode
* added bottom padding to text handle
* add indicator visual to selection handler theme
* improve text selector indicator handling
* add support for wrap around in selection handles
* ensure textbox context menu is shown on hold
* dampen scroll inertia
* increase default tap and double tap sizes for touch and pen
* make textbox context menu horizontal in touch mode. improve context menu show behavior for selection handles
* detect overscroll in scroll presenter and handle scroll gesture if overscrolled
* add rtl detection for selection handles
* improve context flyout behavior in handles
* restore textbox page
* addressed review
* add touch tests textbox
* keep dragged handle visible, adjust flyout position to visible handle
* Introduced "forced" CSD mode without app opting in
* C is for Consistency
* api diff
* [X11] Better handling of forced-vs-app-triggeed CSD
* Round WindowDrawnDecorations sizes to be pixel-aligned
* Split source and target controls in Should_Apply_Design_Mode_Properties_From_Control_To_Window test
* Fix invalid binding being applied
* Use indexer bindings, avoid bind to observable
* Make Window.WindowState a direct property with (on some platforms) reliable values
* Use reported window state from the callback
* compile
* Actually use the cached value in WindowState getter
* api diff
* Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Tests for our erratic WindowState behavior.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Make FlyoutBase.IsOpen a public StyledProperty with two-way binding support
Convert IsOpen from a DirectProperty with a protected setter to a
StyledProperty with a public setter and TwoWay default binding mode.
This enables MVVM scenarios where a ViewModel can control flyout
visibility through data binding.
The implementation mirrors the established Popup.IsOpen pattern:
- Reentrancy guard (BeginIgnoringIsOpen scope) prevents recursive
property change notifications when internal code syncs the property
- SetCurrentValue preserves active bindings and styles (enforced by
analyzer AVP1012)
- _isOpen field tracks actual open state independently of the property
value, since the property system sets the value before the change
handler fires
- _lastPlacementTarget enables re-opening at the last known target
when IsOpen is set to true via binding
- IsOpen reverts to false when no target is available or opening is
cancelled, and reverts to true when closing is cancelled, keeping
the property honest
Fixes#18716
* ci: retrigger checks
* Add API suppression for FlyoutBase.IsOpenProperty type change
Suppress CP0002 for the intentional binary breaking change from
DirectProperty<FlyoutBase, bool> to StyledProperty<bool>.
* Pre-register owning control as flyout placement target
When Button.Flyout or SplitButton.Flyout is set, the owning control
now registers itself as the default placement target via an internal
SetDefaultPlacementTarget method. This allows IsOpen = true to work
on first use without a prior ShowAt call, addressing review feedback
from MrJul.
* Remove TwoWay default binding mode from IsOpenProperty
Follow Avalonia convention: Popup.IsOpen and ToolTip.IsOpen use the
default OneWay binding mode. TwoWay is reserved for input controls.
Users opt in with Mode=TwoWay when needed.
* Add FocusElement.FindNextElementOptions
* Add unit tests for FindNextElementOptions.FocusedElement
* Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* refactor: Replace IsPopup with Enable*Layer properties on VisualLayerManager
- Remove IsPopup from VisualLayerManager, add granular Enable*Layer properties:
EnableAdornerLayer (default true), EnableOverlayLayer (default false),
EnablePopupOverlayLayer (internal, default false), EnableTextSelectorLayer (default false)
- Add PART_VisualLayerManager template part to TopLevel with protected property
- Window and EmbeddableControlRoot override OnApplyTemplate to enable
overlay, popup overlay, and text selector layers
- OverlayLayer is now wrapped in a Panel with a dedicated AdornerLayer sibling
- AdornerLayer.GetAdornerLayer checks for OverlayLayer's dedicated AdornerLayer
- Update all 8 XAML templates (both themes) to name PART_VisualLayerManager
and remove IsPopup="True" from PopupRoot/OverlayPopupHost
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add XML doc to VisualLayerManager
* Also search for AdornerLayer from TopLevel
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>