forked from unoplatform/uno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ea3d5e
commit 3c8e536
Showing
1 changed file
with
38 additions
and
9 deletions.
There are no files selected for viewing
47 changes: 38 additions & 9 deletions
47
src/Uno.UI/UI/Xaml/Automation/Peers/ImageAutomationPeer.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,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; | ||
} | ||
} |