-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
We should consider refactoring the AutomationId property at AccessibleObject class and its descendants. Now 7 descendants of the ControlAccessibleObject class return the Owner.Name value for the AutomationId property at the GetPropertyValue method, and 4 descendants of the AccessibleObject class return AutomationId (which is not virtual now as each class implements it on its own).
We could refactor this property like that:
- move the AutomationId property to the AccessibleObject class (it will be returned at the GetPropertyValue method here)
- make it virtual with the default implementation returning a
nullvalue - keep the current implementations in the 4 classes derived from AO, but mark them as overrides
- move returning of the
Owner.Nameto theControlAccessibleObjectObjectclass itself to make it universal for all its descendants.
This could be risky since some customers could have automation tests that rely on AutomationId and have custom controls derived from our control class that don't implement custom AutomationIdProperty, but maybe code simplification outweighs the risk and at the worst-case scenario we could just revert the future PR with the single AutomationId refactoring.
Original post: #6429 (comment)