* Add failing tests for animations visibility behavior
* Dont trigger InternalStep when IsEffectivelyVisible is false.
* Fix a 6 year old mistake.
Dont spawn a new DoubleAnimator, instead just parse the target Transform object and do a SetValue call for the interpolated animation value.
* add comment and remove redundant else
* use LightweightSubject to avoid hammering the binding system with extra value frames from SetValue as @grokys suggested.
* whitespace
* remove unused namespace
* remove extra fields
* Implement animation pause on invisible and dispose on visual tree detach
* Implement animation pause on invisible and dispose on visual tree detach
* add tests
* check pause state and combo with IEV
* fix review comment
* 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>
Ensure that native control bounds are properly rounded when UseLayoutRounding is enabled.
This prevents alignment issues with Avalonia's visual tree, especially at non-integer scaling factors.
The calculation now uses LayoutHelper.RoundLayoutValue for each edge of the transformed rectangle,
matching how Avalonia rounds other layout elements.
* 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>
* Fix TextBox validation error persisting when reverting to same valid value
When a TwoWay binding with validation had an error and the user set the
target back to the same value that was last successfully written to the
source, WriteTargetValueToSource() would bail out early because the
target value matched LeafNode.Value. This prevented WriteValueToSource()
from being called, so the validation error was never cleared.
Add an ErrorType check to the condition in WriteTargetValueToSource() so
that the write-through still happens when there is a pending validation
error, matching the pattern already used in WriteValueToSource() at
line 310.
Fixes#20534https://claude.ai/code/session_01LTinLuE1bsNKaLPuDSNuuw
* Add test for validation error clearing when reverting to same valid value
Reproduces the scenario from #20534 where a TwoWay binding with a
setter that throws on invalid values fails to clear the validation error
when the target is set back to the same value that was last successfully
written to the source.
https://claude.ai/code/session_01LTinLuE1bsNKaLPuDSNuuw
* Remove redundant checks in WriteTargetValueToSource()
* 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
* Implemented new drawn window decorations API
TODO: check if it works on Win32, bring back titlebar automation peer
* Adjusting naming a bit
* Naming / configuration changes
* Various fixes
* popover fix?
* wip
* Address review
* Extra window roles
* WIP
* Fixed drawn titlebar automation
* Purge ExtendClientAreaChromeHints.
* Fixed dynamically enabling drawn decorations
* api diff
* Add automation IDs for drawn decorations buttons
* Resolved the issues
* build
* Retry a few times when Pager isn't available after test is finished
* Only do faulty test detection if asked
* duplicate package reference
* Try disabling faulty tests on appium1
* Fix ExtendClientAreaWindowTests
* Apply initial button states
* Enable CSD shadow for X11
* net8?
* Address review
* more review comments
* Moar review comments
* Extra hit-test checks
* Moar review
* Prefix integration test app exitfullscreen to avoid clashes
* Disable drawn decorations if parts = None
* Respect SystemDecorations value on mac in extend-client-area mode
* Tidy up logic a bit
* Adjust win32 tests to titlebar not being in the tree when CSD are not enabled
---------
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* 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
GetAbsoluteBounds() was using TransformToAABB only for the position but
then returning the untransformed Bounds.Size. This caused native controls
inside a Viewbox (or any parent with a visual transform) to be sized
incorrectly - the native window would appear at the right position but
at the wrong (unscaled) size.
Use the full transformed rect from TransformToAABB for both position and
size.
Fixes#13832
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
* Implement safe TypeCast expression handling
* Add reflection based (still AOT safe) Path.StreamTask and Path.StreamObservable
* Remove RequiresDynamicCode, as it's no longer true
* Stream bindings are not supported
* ObservableStreamPlugin.MatchesType should handle if type itself is observable
* Fix Cecil not finding generic methods
* Fix missing root automation peer in x11/atspi
* Root nodes are special case; fix GetIndexInParentAsync to handle root nodes since their parents == null.
* Make MathUtilities internal
* Remove old overloads from LayoutHelper
* Make DrawingContextHelper.WrapSkiaCanvas internal
* Update API suppressions
---------
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Add failing test for font without head table
* Use a default DesignEmHeight if the font doesn't have one
* Add new font to Should_AddGlyphTypeface_By_Stream
* fix creation of files/folders in subfolder (instead of the root folder)
* fix delete subfolder (instead of the root folder)
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>
Co-authored-by: Emmanuel Hansen <emmausssss@gmail.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