diff --git a/src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Automation.Peers/MenuFlyoutPresenterAutomationPeer.cs b/src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Automation.Peers/MenuFlyoutPresenterAutomationPeer.cs index 62ac9f7716a1..415166a17e17 100644 --- a/src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Automation.Peers/MenuFlyoutPresenterAutomationPeer.cs +++ b/src/Uno.UI/Generated/3.0.0.0/Microsoft.UI.Xaml.Automation.Peers/MenuFlyoutPresenterAutomationPeer.cs @@ -3,12 +3,12 @@ #pragma warning disable 114 // new keyword hiding namespace Microsoft.UI.Xaml.Automation.Peers { -#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ +#if false [global::Uno.NotImplemented] #endif public partial class MenuFlyoutPresenterAutomationPeer : global::Microsoft.UI.Xaml.Automation.Peers.ItemsControlAutomationPeer { -#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ +#if false [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] public MenuFlyoutPresenterAutomationPeer(global::Microsoft.UI.Xaml.Controls.MenuFlyoutPresenter owner) : base(owner) { diff --git a/src/Uno.UI/UI/Xaml/Automation/Peers/MenuFlyoutPresenterAutomationPeer.cs b/src/Uno.UI/UI/Xaml/Automation/Peers/MenuFlyoutPresenterAutomationPeer.cs index 62ac9f7716a1..cad534dcfa9d 100644 --- a/src/Uno.UI/UI/Xaml/Automation/Peers/MenuFlyoutPresenterAutomationPeer.cs +++ b/src/Uno.UI/UI/Xaml/Automation/Peers/MenuFlyoutPresenterAutomationPeer.cs @@ -1,20 +1,46 @@ -// -#pragma warning disable 108 // new keyword hiding -#pragma warning disable 114 // new keyword hiding -namespace Microsoft.UI.Xaml.Automation.Peers +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See LICENSE in the project root for license information. +// MUX Reference dxaml\xcp\dxaml\lib\MenuFlyoutPresenterAutomationPeer_Partial.cpp, tag winui3/release/1.5.4, commit 98a60c8 + +using Microsoft.UI.Xaml.Controls; + +namespace Microsoft.UI.Xaml.Automation.Peers; + +/// +/// Exposes MenuFlyoutPresenter types to Microsoft UI Automation. +/// +public partial class MenuFlyoutPresenterAutomationPeer : ItemsControlAutomationPeer { -#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - [global::Uno.NotImplemented] -#endif - public partial class MenuFlyoutPresenterAutomationPeer : global::Microsoft.UI.Xaml.Automation.Peers.ItemsControlAutomationPeer + /// + /// Initializes a new instance of the MenuFlyoutPresenterAutomationPeer class. + /// + /// The owner element to create for. + public MenuFlyoutPresenterAutomationPeer(MenuFlyoutPresenter owner) : base(owner) { -#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__ - [global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")] - public MenuFlyoutPresenterAutomationPeer(global::Microsoft.UI.Xaml.Controls.MenuFlyoutPresenter owner) : base(owner) + } + + protected override string GetAutomationIdCore() + { + var result = base.GetAutomationIdCore(); + if (string.IsNullOrEmpty(result)) + { + result = ((MenuFlyoutPresenter)Owner).GetOwnerName(); + } + return result; + } + + protected override string GetClassNameCore() => nameof(MenuFlyoutPresenter); + + protected override AutomationControlType GetAutomationControlTypeCore() => AutomationControlType.Menu; + + protected override ItemAutomationPeer OnCreateItemAutomationPeer(object item) + { + // Not providing automation peer for separator element + if (item is MenuFlyoutSeparator) { - global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Microsoft.UI.Xaml.Automation.Peers.MenuFlyoutPresenterAutomationPeer", "MenuFlyoutPresenterAutomationPeer.MenuFlyoutPresenterAutomationPeer(MenuFlyoutPresenter owner)"); + return null; } -#endif - // Forced skipping of method Microsoft.UI.Xaml.Automation.Peers.MenuFlyoutPresenterAutomationPeer.MenuFlyoutPresenterAutomationPeer(Microsoft.UI.Xaml.Controls.MenuFlyoutPresenter) + + return new ItemAutomationPeer(item, this); // TODO:MZ: Currently throws } }