* 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.
* 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
* Extracted IInputRoot out of TopLevel
* Move some input handling out of TopLevel
* Remove old class, make layout manager private
* Removed IRenderRoot
* Make VisualTreeAttachmentEventArgs a bit more sensible
* Move ILayoutRoot to PresentationSource
# Conflicts:
# tests/Avalonia.Controls.UnitTests/TabControlTests.cs
* Updated some VisualRoot / GetVisualRoot usages
* Updated more XxxRoot usages
* More Root usages
* Addressed review
* Hurr-durr xml
* More fixes
* Maybe fix android compilation
* API diff
* Yet another cast
* I had to use MSIL analysis to detect those casts
* Fixed automation
* Fix PointerOverPreProcessor
* Fix?
* Removed yet another cast to Visual
* The amount of random downcasts is astonishing
* Maybe fix mac
* Addressed review
* Add CustomPopupPlacement API
* Add Placement="Custom" support for Flyout, ToolTip and ContextMenu controls as well
* Adjust some API changes
* Add Avalonia.Controls.Primitives.IPopupHost.ConfigurePosition breaking change
* Extract new types into separated files
* Fix build after merge conflict
* Adjust nupkg.xml
* Dispose property subscriptions after popup is closed, avoiding flickering
* Adjust API to be more future proof and add new parameters.
* Add new ContextRequestedEventArgs overload while I am on it
* Updated Popup to raise the pass-through overlay dismiss event prior to possibly closing the popup when a pointer is pressed. Added the PopupFlyoutBase.OverlayDismissEventPassThrough property and updated logic in Button.
* Updated SplitButton logic to handle OverlayDismissEventPassThrough scenarios.
* Updated CalendarDatePicker logic to handle OverlayDismissEventPassThrough scenarios.
* Updated ComboBox logic to handle OverlayDismissEventPassThrough scenarios.
* Removed unncessary ComboBox.PopupClosed logic that focused the control. This was problematic when the popup was open with OverlayDismissEventPassThrough and clicking onto another control. Focus would not move to the clicked control.
* Fixed the Clicking_On_Control_PseudoClass unit test to properly recognize pseudo-class behavior change.
* Added a couple unit tests to FlyoutTests.
* Add Popup.SetPopupParent helper method
* Update Tooltip to use Popup internally instead of PopupRoot
* Mark OverlayPopupHost.CreatePopupHost as unstable method
* Close tooltip when popup is closed
* Fix popups not closing when target is detached
* Remove unrelated change
* Add `PlacementConstraintAdjustmentProperty` to PopupFlyoutBase
This adds much more flexibility to control flyout positioning when there is not enough space to show the Flyout.
* Make Fylout position of the ColorPicker a DynamicResource
This allows the position to be overridden easily. It should no longer be hard coded.
* Address review