/// <summary> /// Checks if the given pattern is available for the element via properties /// </summary> public bool IsPatternSupported(PatternId pattern) { if (Equals(pattern, PatternId.NotSupportedByFramework)) { return false; } if (pattern.AvailabilityProperty == null) { throw new ArgumentException("Pattern doesn't have an AvailabilityProperty"); } var success = FrameworkAutomationElement.TryGetPropertyValue(pattern.AvailabilityProperty, out bool isPatternAvailable); return success && isPatternAvailable; }
/// <inheritdoc /> public bool TryGetValue(out TVal value) { return(FrameworkAutomationElement.TryGetPropertyValue(PropertyId, out value)); }