Skip to content

Commit

Permalink
feat: Port ImageAutomationPeer
Browse files Browse the repository at this point in the history
  • Loading branch information
morning4coffe-dev committed Jan 10, 2024
1 parent 0ea3d5e commit 3c8e536
Showing 1 changed file with 38 additions and 9 deletions.
47 changes: 38 additions & 9 deletions src/Uno.UI/UI/Xaml/Automation/Peers/ImageAutomationPeer.cs
Original file line number Diff line number Diff line change
@@ -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;

/// <summary>
/// Exposes Image types to Microsoft UI Automation.
/// </summary>
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;
}
}

0 comments on commit 3c8e536

Please sign in to comment.