/// <summary> /// Helper for reading AutomationId property from a StyledElement. /// </summary> public static string GetAutomationId(StyledElement element) { if (element == null) { throw new ArgumentNullException(nameof(element)); } return(element.GetValue(AutomationIdProperty)); }
/// <summary> /// Helper for reading AccessibilityView property from a StyledElement. /// </summary> public static AccessibilityView GetAccessibilityView(StyledElement element) { if (element == null) { throw new ArgumentNullException(nameof(element)); } return(element.GetValue(AccessibilityViewProperty)); }
/// <summary> /// Helper for reading AccessKey property from a StyledElement. /// </summary> public static string GetAccessKey(StyledElement element) { if (element == null) { throw new ArgumentNullException(nameof(element)); } return((string)element.GetValue(AccessKeyProperty)); }
/// <summary> /// Gets the value of the attached <see cref="NameScopeProperty"/> on a styled element. /// </summary> /// <param name="styled">The styled element.</param> /// <returns>The value of the NameScope attached property.</returns> public static INameScope GetNameScope(StyledElement styled) { Contract.Requires <ArgumentNullException>(styled != null); return(styled.GetValue(NameScopeProperty)); }
/// <summary> /// Gets the value of the attached <see cref="NameScopeProperty"/> on a styled element. /// </summary> /// <param name="styled">The styled element.</param> /// <returns>The value of the NameScope attached property.</returns> public static INameScope GetNameScope(StyledElement styled) { _ = styled ?? throw new ArgumentNullException(nameof(styled)); return(styled.GetValue(NameScopeProperty)); }