* Add missing AutomationPeers from built-in Controls.
* revert native menu bar peers
* Add back a thin automation peer for native menu bar.
* Use ColorChanged for ColorSpectrumAutomationPeer
* Fix NativeMenuBar/ColorSpectrum automation peer regressions
Flatten MenuItem children under NativeMenuBarAutomationPeer and raise ColorChanged when Color is set directly so ColorSpectrumAutomationPeer notifies AT clients.
* Drop NativeMenuBarAutomationPeer.GetChildrenCore override
Bisect confirmed this override caused 5 Windows IT tests (Slider, Screen, DragDrop) to fail by producing an inconsistent UIA tree where MenuItem peers list NativeMenuBar as parent while their visual parent is the inner Menu. Reverted to the thin peer that only reports ControlType=MenuBar, and dropped the now-irrelevant children assertion test.
AutomationElementIdentifiers.AutomationIdProperty was missing, so
runtime changes to AutomationProperties.AutomationId never raised
UIA_AutomationPropertyChangedEventId on Windows (or the equivalent
on macOS). UIA clients that subscribe to property changes would
silently receive stale automation IDs.
- Add AutomationIdProperty sentinel to AutomationElementIdentifiers
- Raise the event in ControlAutomationPeer.OwnerPropertyChanged
when AutomationProperties.AutomationIdProperty changes
- Add AutomationIdProperty -> UiaPropertyId.AutomationId to the Win32
AutomationNode.s_propertyMap
- Add AutomationPeer_AutomationId to AvnAutomationProperty (avn.idl)
and wire it in AvnAutomationPeer.s_propertyMap and automation.mm
- Add unit tests covering runtime AutomationId change notifications
* 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>
* 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: 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>
* 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.
* 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>
* test: verify ShowCore applies default icon when no custom icon is set
Adds a test that verifies Window.Show() applies the default icon via
SetIcon when no custom icon has been set. Currently fails because
ShowCore has no default icon logic — the fallback only exists in the
constructor binding where it eagerly loads the icon.
Relates to #20478
* fix: defer default icon loading from constructor to ShowCore
The default icon was eagerly loaded during Window construction via
CreatePlatformImplBinding, even when a custom icon would be set or no
icon was needed. This caused unnecessary I/O (assembly resource loading)
on every first Window instantiation.
Move the default icon fallback from the binding lambda to ShowCore,
so LoadDefaultIcon only runs when the window is actually shown and
no custom icon has been set.
Fixes#20478
* Add failing tests for #18280 and #20845
Tests cover:
- TabItem child DataContext binding not resolving (#20845)
- DataContext binding not propagating to TabItem children (#20845)
- DataContext binding not surviving tab switch round-trip (#20845)
- UserControl content losing DataContext on tab switch (#18280)
- Content temporarily getting wrong DataContext when switching tabs
- Transition not applying new DataContext to old content
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix TabControl DataContext issues (#18280, #20845)
Add ContentPresenter.SetContentWithDataContext to atomically set Content
and DataContext, preventing the intermediate state where setting Content
to a Control clears DataContext and causes the content to briefly inherit
the wrong DataContext from higher up the tree.
TabControl.UpdateSelectedContent now uses this method, and the DataContext
subscription no longer applies the new container's DataContext to the old
content during page transitions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add tests for ContentTemplate with Control content DataContext
When a TabItem has a ContentTemplate and its Content is a Control, the
ContentPresenter should set DataContext to the content (so the template
can bind to the control's properties), not the TabItem's DataContext.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Only use SetContentWithDataContext when no ContentTemplate is set
When a ContentTemplate is present and content is a Control, the
ContentPresenter should set DataContext = content so the template can
bind to the control's properties. Only override DataContext with the
container's DataContext when there's no template (i.e. the presenter
displays the control directly).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* Send Page lifecycle events after page transitions
* Cleanup
* Moved the push lifecycle calls out of ExecutePushCore
---------
Co-authored-by: Javier Suárez Ruiz <javiersuarezruiz@hotmail.com>
* Add failing test for #20688
Unit test created from issue description
* Add a failing test for wrong CacheLength handling
All items would be realized which is obviously wrong
* fix test setup used StackPanel instead of expcected
VirtualizingStackPanel
* Make sure the test actually fails
* update comment
* Fix for focusedElement and focusedIndex
* add another unit test
* Fixes for new test cases
* Addressing Review
* Update tests to match new behavior
* only recycle focused element if it is not null
* Address review
* Address copilot review
* add failing test
* fix StartU estimation
* remove unused sample file
* move gesture events from Gestures to InputElement. Fix holding gesture interactions with context menu
* update api diff
* address review comments
* fix some test types
* rename Cancelled to Canceled
* update api diff