-
Notifications
You must be signed in to change notification settings - Fork 743
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: MenuFlyoutPresenterAutomationPeer
- Loading branch information
1 parent
b2b8de4
commit 26d5000
Showing
2 changed files
with
42 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 40 additions & 14 deletions
54
src/Uno.UI/UI/Xaml/Automation/Peers/MenuFlyoutPresenterAutomationPeer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |