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.
feat: Implement
TextBoxAutomationPeer
- Loading branch information
1 parent
9bfa9e9
commit dd78821
Showing
1 changed file
with
23 additions
and
19 deletions.
There are no files selected for viewing
42 changes: 23 additions & 19 deletions
42
src/Uno.UI/UI/Xaml/Automation/Peers/TextBoxAutomationPeer.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,31 +1,35 @@ | ||
using System.Collections.Generic; | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
// MUX Reference TextBoxAutomationPeer_Partial.cpp, tag winui3/release/1.4.2 | ||
using System.Collections.Generic; | ||
using Microsoft.UI.Xaml.Controls; | ||
|
||
namespace Microsoft.UI.Xaml.Automation.Peers | ||
namespace Microsoft.UI.Xaml.Automation.Peers; | ||
|
||
/// <summary> | ||
/// Exposes TextBox types to Microsoft UI Automation. | ||
/// </summary> | ||
public partial class TextBoxAutomationPeer : FrameworkElementAutomationPeer | ||
{ | ||
public partial class TextBoxAutomationPeer : FrameworkElementAutomationPeer | ||
public TextBoxAutomationPeer(TextBox owner) : base(owner) | ||
{ | ||
public TextBoxAutomationPeer(TextBox owner) : base(owner) | ||
{ | ||
} | ||
} | ||
|
||
protected override string GetClassNameCore() | ||
{ | ||
return "RichEditBox"; | ||
} | ||
protected override string GetClassNameCore() => nameof(TextBox); | ||
|
||
protected override AutomationControlType GetAutomationControlTypeCore() | ||
{ | ||
return AutomationControlType.Edit; | ||
} | ||
protected override AutomationControlType GetAutomationControlTypeCore() | ||
=> AutomationControlType.Edit; | ||
|
||
protected override bool IsControlElementCore() | ||
protected override IEnumerable<AutomationPeer> GetDescribedByCore() | ||
{ | ||
if (Owner is TextBox owner) | ||
{ | ||
return true; | ||
//UNO TODO Implement TextBoxPlaceholderTextHelper | ||
//IFC_RETURN(TextBoxPlaceholderTextHelper::SetupPlaceholderTextBlockDescribedBy(spOwner)); | ||
|
||
return base.GetDescribedByCore(); | ||
} | ||
|
||
// TODO: Add support for PlaceholderText and Label | ||
// Accessibility priority: Name > LabeledBy > Header > PlaceholderText | ||
// LabeledBy: Header, DescribedBy: PlaceholderText | ||
return []; | ||
} | ||
} |