diff --git a/src/Uno.UI/UI/Xaml/Automation/Peers/ImageAutomationPeer.cs b/src/Uno.UI/UI/Xaml/Automation/Peers/ImageAutomationPeer.cs index abecb27cdfc9..c98110f3d586 100644 --- a/src/Uno.UI/UI/Xaml/Automation/Peers/ImageAutomationPeer.cs +++ b/src/Uno.UI/UI/Xaml/Automation/Peers/ImageAutomationPeer.cs @@ -1,19 +1,48 @@ -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 ImageAutomationPeer_Partial.cpp, tag winui3/release/1.4.2 + +namespace Microsoft.UI.Xaml.Automation.Peers; + +/// +/// Exposes Image types to Microsoft UI Automation. +/// +public partial class ImageAutomationPeer : FrameworkElementAutomationPeer { - public partial class ImageAutomationPeer : FrameworkElementAutomationPeer + public ImageAutomationPeer(Controls.Image owner) : base(owner) { - public ImageAutomationPeer(Controls.Image owner) : base(owner) - { - } + } + + protected override string GetClassNameCore() => nameof(Controls.Image); - protected override string GetClassNameCore() + protected override AutomationControlType GetAutomationControlTypeCore() + => AutomationControlType.Image; + + protected override string GetNameCore() + { + var length = base.GetNameCore()?.Length ?? 0; + + if (length == 0) { - return "Image"; + var image = Owner as Controls.Image; + return image.Name; } - protected override AutomationControlType GetAutomationControlTypeCore() + return null; + } + + protected override string GetFullDescriptionCore() + { + var length = base.GetFullDescriptionCore()?.Length ?? 0; + + if (length == 0) { - return AutomationControlType.Image; + var image = Owner as Controls.Image; + + //TODO UNO Description on Item is not implemented + return null; } + + return null; } }