The validating layer introduced in #7369 has done its job and caught a few bugs, but was causing difficulties in certain places so removing it now.
Fixes#7573
Add support for selection wrapping for ListBox, ItemsControl, ComboBox.
Co-authored-by: Steven Kirk <grokys@users.noreply.github.com>
Co-authored-by: Takoooooo <tako0qq@gmail.com>
Co-authored-by: Steven Kirk <grokys@gmail.com>
#7369 introduced a validating layer over `WindowBase.PlatformImpl` that is only enabled in debug mode. This validating layer was causing unit tests to fail in debug mode but not on CI which runs tests in release mode.
Fix the problems:
- `PopupRoot` was not correctly disposing itself on `Dispose` - make it call `HandleClosed` in order to perform the same steps as when the popup is closed via other means
- Some unit tests try to access the `PlatformImpl` to get hold of a mock. Added `ValidatingWindowImpl.Unwrap` to allow this
- `ValidatingWindowBaseImpl.Activated` was setting the wrong property on the wrapped `PlatformImpl`.
* [MenuItem] [Performance] Evaluate CanExecute on menu show and only if menu is visible
* [Revert] a change from another PR
* Update tests/Avalonia.Controls.UnitTests/MenuItemTests.cs
Co-authored-by: Steven Kirk <grokys@users.noreply.github.com>
* Update tests/Avalonia.Controls.UnitTests/MenuItemTests.cs
Co-authored-by: Steven Kirk <grokys@users.noreply.github.com>
* fix typo
* [MenuItem] fix IsEffectivelyEnabled and cover with tests
Co-authored-by: Steven Kirk <grokys@users.noreply.github.com>
Co-authored-by: Max Katz <maxkatz6@outlook.com>
* Added failing tests for #838.
* Fix Text events when setting SelectedText.
Only raise a single property changed event on `Text` when setting `SelectedText`. It's a bit ugly but the whole of `TextBox` needs a refactor...
Fixes#838.
When a native popup window is positioned relative to a placement target on
the root window and the root window is moved or resized, the popup position
should update to reflect the new position of the placement target.
If a native popup window is positioned relative to another popup, as in the
case of sub-menus, and the parent popup is moved due to a change in the
position of its placement target, the child popup should also update
relative to the new position of the parent popup.
And no longer target net461 in unit tests as we've not had a test pass in net core and fail in netfx in years, and it bloats our CI time; EXCEPT Avalonia.Markup.Xaml.UnitTests where we're still testing against net4.7 as MSIL generation is runtime-sensitive.
Pointer clicks on disabled and non-interactive items in sub-menus
are bubbled up to the sub-menu's parent, causing the sub-menu popup
to be closed when it is expected to remain open. This scenario is
identified and filtered out by searching for a popup in the logical
tree between the source and the handler. Fixes#6412.
* Fix#6224
* Fix data templates Match
* Do not use preview features
* Do not create Child if Content is null and DataTemplate was set
* Update src/Avalonia.Base/Utilities/TypeUtilities.cs
* Update src/Avalonia.Controls/Presenters/ContentPresenter.cs
* Update src/Avalonia.Controls/Presenters/ContentPresenter.cs
- Adds a "resize reason" to platform `Resized` events
- Which is used by the auto-sizing code to determine whether to reset `SizeToContent`
- Also other improvements to the reset logic for `SizeToContent`:
- Don't reset it if the size hasn't changed
- Don't reset it if `CanResize == false`
- Only reset the dimensions whose size has changed
- Obsolete the `BeginAutoSizing`/`AutoSizing` feature in `WindowBase`