diff --git a/src/Avalonia.Controls/Automation/AutomationElementIdentifiers.cs b/src/Avalonia.Controls/Automation/AutomationElementIdentifiers.cs
index 8cdee8e3fe..9e28080cb5 100644
--- a/src/Avalonia.Controls/Automation/AutomationElementIdentifiers.cs
+++ b/src/Avalonia.Controls/Automation/AutomationElementIdentifiers.cs
@@ -31,6 +31,12 @@ namespace Avalonia.Automation
///
public static AutomationProperty HelpTextProperty { get; } = new AutomationProperty();
+ ///
+ /// Identifies the itemStatus automation property. The class name property value is returned
+ /// by the method.
+ ///
+ public static AutomationProperty ItemStatusProperty { get; } = new AutomationProperty();
+
///
/// Identifies the landmark type automation property. The class name property value is returned
/// by the method.
diff --git a/src/Avalonia.Controls/Automation/Peers/AutomationPeer.cs b/src/Avalonia.Controls/Automation/Peers/AutomationPeer.cs
index 56111bdc83..b32b60118c 100644
--- a/src/Avalonia.Controls/Automation/Peers/AutomationPeer.cs
+++ b/src/Avalonia.Controls/Automation/Peers/AutomationPeer.cs
@@ -319,6 +319,41 @@ namespace Avalonia.Automation.Peers
///
public int GetHeadingLevel() => GetHeadingLevelCore();
+
+ ///
+ /// Gets the item type that is associated with this automation peer.
+ ///
+ ///
+ ///
+ /// -
+ /// Windows
+ /// UIA_ItemTypePropertyId
+ ///
+ /// -
+ /// macOS
+ /// No mapping.
+ ///
+ ///
+ ///
+ public string? GetItemType() => GetItemTypeCore();
+
+ ///
+ /// Gets the item status that is associated with this automation peer.
+ ///
+ ///
+ ///
+ /// -
+ /// Windows
+ /// UIA_ItemStatusPropertyId
+ ///
+ /// -
+ /// macOS
+ /// No mapping.
+ ///
+ ///
+ ///
+ public string? GetItemStatus() => GetItemStatusCore();
+
///
/// Gets the that is the parent of this .
///
@@ -562,6 +597,8 @@ namespace Avalonia.Automation.Peers
protected virtual string? GetHelpTextCore() => null;
protected virtual AutomationLandmarkType? GetLandmarkTypeCore() => null;
protected virtual int GetHeadingLevelCore() => 0;
+ protected virtual string? GetItemTypeCore() => null;
+ protected virtual string? GetItemStatusCore() => null;
protected abstract AutomationPeer? GetParentCore();
protected abstract bool HasKeyboardFocusCore();
protected abstract bool IsContentElementCore();
diff --git a/src/Avalonia.Controls/Automation/Peers/ControlAutomationPeer.cs b/src/Avalonia.Controls/Automation/Peers/ControlAutomationPeer.cs
index 1c7261bd2a..0536da4dbd 100644
--- a/src/Avalonia.Controls/Automation/Peers/ControlAutomationPeer.cs
+++ b/src/Avalonia.Controls/Automation/Peers/ControlAutomationPeer.cs
@@ -192,6 +192,8 @@ namespace Avalonia.Automation.Peers
protected override string? GetAutomationIdCore() => AutomationProperties.GetAutomationId(Owner) ?? Owner.Name;
protected override Rect GetBoundingRectangleCore() => GetBounds(Owner);
protected override string GetClassNameCore() => Owner.GetType().Name;
+ protected override string? GetItemStatusCore() => AutomationProperties.GetItemStatus(Owner);
+ protected override string? GetItemTypeCore() => AutomationProperties.GetItemType(Owner);
protected override bool HasKeyboardFocusCore() => Owner.IsFocused;
protected override bool IsContentElementCore() => true;
protected override bool IsControlElementCore() => true;
@@ -274,6 +276,13 @@ namespace Avalonia.Automation.Peers
{
InvalidateParent();
}
+ else if (e.Property == AutomationProperties.ItemStatusProperty)
+ {
+ RaisePropertyChangedEvent(
+ AutomationElementIdentifiers.ItemStatusProperty,
+ e.OldValue,
+ e.NewValue);
+ }
}
diff --git a/src/Windows/Avalonia.Win32.Automation/AutomationNode.cs b/src/Windows/Avalonia.Win32.Automation/AutomationNode.cs
index 8562807452..78f562decf 100644
--- a/src/Windows/Avalonia.Win32.Automation/AutomationNode.cs
+++ b/src/Windows/Avalonia.Win32.Automation/AutomationNode.cs
@@ -39,6 +39,7 @@ namespace Avalonia.Win32.Automation
{ AutomationElementIdentifiers.HelpTextProperty, UiaPropertyId.HelpText },
{ AutomationElementIdentifiers.LandmarkTypeProperty, UiaPropertyId.LandmarkType },
{ AutomationElementIdentifiers.HeadingLevelProperty, UiaPropertyId.HeadingLevel },
+ { AutomationElementIdentifiers.ItemStatusProperty, UiaPropertyId.ItemStatus },
{ ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty, UiaPropertyId.ExpandCollapseExpandCollapseState },
{ RangeValuePatternIdentifiers.IsReadOnlyProperty, UiaPropertyId.RangeValueIsReadOnly},
{ RangeValuePatternIdentifiers.MaximumProperty, UiaPropertyId.RangeValueMaximum },
@@ -135,6 +136,8 @@ namespace Avalonia.Win32.Automation
UiaPropertyId.IsEnabled => InvokeSync(() => Peer.IsEnabled()),
UiaPropertyId.IsKeyboardFocusable => InvokeSync(() => Peer.IsKeyboardFocusable()),
UiaPropertyId.IsOffscreen => InvokeSync(() => Peer.IsOffscreen()),
+ UiaPropertyId.ItemType => InvokeSync(() => Peer.GetItemType()),
+ UiaPropertyId.ItemStatus => InvokeSync(() => Peer.GetItemStatus()),
UiaPropertyId.LocalizedControlType => InvokeSync(() => Peer.GetLocalizedControlType()),
UiaPropertyId.Name => InvokeSync(() => Peer.GetName()),
UiaPropertyId.HelpText => InvokeSync(() => Peer.GetHelpText()),