Open mrlacey opened 7 years ago
@mrlacey Yes good recommendation, ideally this new XAML Standard 1.0 specification, define the primitive object with these properties, for example in the abstract class FrameworkElement or UIElement
[crutkas edited to remove unnecessary cross linking]
Just don't do it like in html. Too much stuff to add
@birbilis What specifically don't you like about adding accessibility features to HTML? Roles, aria-* attributes, or something else? Do you see/know a way of supporting automation and accessibility without adding extra properties?
I'm pushing for equivalents of AutomationProperties
from UWP and AccessibilityEffect
from Xamarin.Forms.
especially the ARIA stuff are too verbose
imagine that one has to also localize strings like accessible descriptions that end up most of the times being duplicates with tooltips
why is it so hard for the system to reuse a tooltip as accessible description if the accessible description is missing? Could even have the UI system not do it and have a more clever screen reader, but I get the notion of not having screen readers understand and inspect each UI system's graph, but use a UI automation API instead. I just don't want as dev to have to write and localize redundant strings
also I want less verbose XAML to read, so accessible properties that are not specific to a control instance should be settable once if possible for each class of UI items via some style / control template.
long field names are also bad for readability btw
as for matching Label controls to their matching UI controls, it could be done via binding by element name (as long as shorthand syntax for binding by name is also supported like done in Avalonia - see https://github.com/Microsoft/xaml-standard/issues/60).
question is if Label should have a field for the control it matches, or if control should have a field for the label that matches to it. Adding to the Label the field means existing controls don't need modification but then you need a Label Manager API so that having a control you can ask for its label without traversing the UI graph yourself. Also may need to have namespace contexts there based on visual hierarchy / graph, think WPF has such a thing so that you don't have confusion with same named controls. But might remember wrong. Also dot syntax could be used to refer to a deeper context (can combine this with dot syntax for propery setting and binding maybe - https://github.com/Microsoft/xaml-standard/issues/94)
I understand that some sectors have legal responsibility to implement specific accessibility protocols (say ARIA in webpages), but don't think there is a platform agnostic one for native UIs
So, would help to have some basic accessibility properties that map to platform specific ones underneath, but would also like to see functionality for those who want to avoid using those properties when they become redundant (like the tooltip case I mentioned above)
@birbilis wow. lots of text there and I'm not sure I understand all your points, but:
Automation
, would Automation.Visibility
be too long?@mrlacey I fully agree with you, and besides the same that is in the XAML Standard 1.0, and is already implemented in the APIs, the developer is the one who has the final word on what he will implement in the Software he is developing.
Seems your wish was granted :-) https://blog.xamarin.com/accessbility-xamarin-forms
Note: With the release of Xamarin.Forms 2.3.5-pre3, we have renamed the Accessibility class’s name to AutomationProperties.
iOS, Android, and Windows all expose APIs for developers to build accessible mobile apps for everyone. We’re excited to announce that we’ve added new APIs for accessibility in Xamarin.Forms to make it even easier for developers to build accessible, cross-platform mobile applications. In this post, we’ll take a look at new APIs added to Xamarin.Forms that make it easy to build accessible mobile applications. AutomationProperties APIs in Xamarin.Forms
Xamarin.Forms 2.3.5 provides a base set of hint-related accessibility APIs. They consist of the following:
AutomationProperties.Hint AutomationProperties.IsInAccessibleTree AutomationProperties.LabeledBy AutomationProperties.Name
By defining these properties, we can utilize the underlying accessibility functionality in iOS and Android, such as VoiceOver.
Here's sample code from that article:
<toolkit:EntryLine
Text="{Binding Email}"
Keyboard="Email"
HorizontalOptions="FillAndExpand"
Placeholder="email address"
x:Name="EntryEmail"
StyleId="EmailTextField"
IsEnabled="{Binding IsNotBusy}"
BorderColor="#ECECEC"
AutomationProperties.Hint="Enter your email here"
AutomationProperties.IsInAccessibleTree="true"
AutomationProperties.Name="Email entry field">
<toolkit:EntryLine.HorizontalTextAlignment>
<OnPlatform x:TypeArguments="TextAlignment" iOS="Center"/>
</toolkit:EntryLine.HorizontalTextAlignment>
</toolkit:EntryLine>
(Deleted... moving to #14)
Actually there are several issues logged already (https://github.com/Microsoft/xaml-standard/issues/14, https://github.com/Microsoft/xaml-standard/issues/35, https://github.com/Microsoft/xaml-standard/issues/70) on both platform specific markup and platform specific properties. Despite one's personal taste there are scenarios where those are needed, especially to cover cases till something is added/standardized at a newer evolution cycle in the XAML standard
Also checkout these regarding "Implicit ARIA semantics"
http://html5doctor.com/on-html-belts-and-aria-braces/
http://rawgit.com/w3c/aria/master/aria/aria.html#implicit_semantics
and probably this is interesting too
https://www.w3.org/TR/wai-aria-1.1/#co-evolution
so, grounded on "implicit semantics" concept, when there's a Tooltip property, I believe the AutomationProperties.Hint should be redundant (should be autofilled upon read with ToString() from the tooltip content [assuming a XAML tooltip, not just a string]) and only if explicitly provided should be used instead of the tooltip text with screen readers etc. accessing the automation API
Created apps need to be able to support automation for the purposes of testing and accessibility tools.
I believe the absolute minimum needed are:
AccessibilityView
in UWP orInAccessibleTree
in Xamarin.Forms)The above should be supported by ALL controls in the standard.
Additional related features/properties could be added in later versions.
Automation properties are needed for many testing scenarios having them from the start will be invaluable to those wanting to test their apps that use XAML Standard.
Accessibility is often considered as a "nice to have" or something that can be added later. It would be great to demonstrate Microsoft's commitment to building software that empowers every person to achieve more by including the ability to build software for every person right from the start of this project.