Skip to content

Commit

Permalink
feat: MenuFlyoutPresenterAutomationPeer
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Jun 20, 2024
1 parent b2b8de4 commit 26d5000
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,46 @@
// <auto-generated>
#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;

/// <summary>
/// Exposes MenuFlyoutPresenter types to Microsoft UI Automation.
/// </summary>
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
/// <summary>
/// Initializes a new instance of the MenuFlyoutPresenterAutomationPeer class.
/// </summary>
/// <param name="owner">The owner element to create for.</param>
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
}
}

0 comments on commit 26d5000

Please sign in to comment.