* Handle Datavalidations on base class "Control"
this removes the need to override it in any sub-classing control and also allowes developers to add validation support for other properties / controls by overriding Metadata
* Revert changes on Button.
The current behavior is that button gets disabled and until we decide if this is desired, keep this behavior.
* Add unit test for sub menu item testing
* Parent menu items should not be disabled on command binding failure.
If a menu has a failed `Command` binding, but also has sub-menu items, then it should not be disabled.
---------
Co-authored-by: Anastassia Pellja <anyka545@gmail.com>
* fix accelerator behavior for menu items and labels
* add elements with matching accelerator to test cycling in sub menus
* Add AccessKeyHandler tests for accelerators with more than one match
* Implement accelerator behavior based on WPF handling
* Remove commented code
* Remove OnAccessKey override => handled by DefaultMenuInteractionHandler
* remove obsolete test
* handle OnAccessKeyPressed for selected tab item
* fix unit tests
* use AccessKeyEvent instead of AccessKeyPressedEvent in unit tests
* navigate menu with and without ALT key
* Revert formatting changes in Tests
* Fix AccessKeyHandler comments
* move private types to bottom
* Remove lock statements, optimize removal of AccessKeyRegistrations
* remove call to Dispatcher.UIThread.Post
* simplifiy AccessKeyHandler.SortByHierarchy
* remove unnecessary method AccessKeyHandler.GetTargetsForSender
* regenerate API suppression file
* revert unneeded changes in MenuPage.axaml
* correct formatting changes
* do not sort by hierarchy if too few targets
* make AccessKeyEventArgs internal
* make AccessKeyPressedEventArgs internal
---------
Co-authored-by: Hans Docsek <hans.docsek@gmail.com>
* Refactor IntegrationTestApp.
Use a `ListBox` to switch pages instead of a `TabControl`: the `TabControl` didn't adapt well to smaller screen sizes, and the `MainWindow` was getting unwieldy anyway.
* Update tests to use new pager.
Move logic for selecting the page to a base class as we may need to handle scrolling manually on macOS at some point (Appium on macOS doesn't scroll elements into view automatically).
* Add AutomationPeer.IsOffscreen.
This is needed in order for controls to be scrolled into view using WinAppDriver. The default is the same as WPF and the default value is overridden in the same controls as WPF (where present).
* test: CommandParameter does not change between CanExecute and Execute
* feat: CommandParameter does not change between CanExecute and Execute
* test: update
The `PointerEnteredItem` and `PointerExitedItem` were using an obsolete API to create the event args. We don't need a `PointerEventArgs` anyway, just use `RoutedEventArgs`.
Don't focus the menu item when simply hovering over a top-level menu item. The item should only be focused when the containing menu is open.
Fixes#7906
* [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>