Retrieves the specified pattern object on this AutomationElement.
Assembly: UIAutomationClient (in UIAutomationClient.dll)
- Type: System.Windows.Automation.AutomationPattern
The identifier of the pattern to retrieve.
gets the specified pattern based on its availability at the time of the call.
For some forms of UI, this method will incur cross-process performance overhead. Applications can concentrate overhead by caching patterns and then retrieving them by using GetCachedPattern.
The following example shows how to use this method to retrieve a SelectionItemPattern, which is then used to select an item in a list box.
For often-repeated tasks such as the one in the example, it would be more efficient to cache the pattern and use GetCachedPattern.