A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

29 lines
772 B

using Avalonia.Controls;
#nullable enable
namespace Avalonia.Automation.Peers
{
public class TextBlockAutomationPeer : ControlAutomationPeer
{
public TextBlockAutomationPeer(TextBlock owner)
: base(owner)
{
}
public new TextBlock Owner => (TextBlock)base.Owner;
protected override AutomationControlType GetAutomationControlTypeCore()
{
return AutomationControlType.Text;
}
protected override string? GetNameCore() => Owner.Text;
protected override bool IsControlElementCore()
{
// Return false if the control is part of a control template.
return Owner.TemplatedParent is null && base.IsControlElementCore();
}
}
}