[Spec, WIP] Accessibility.LeafFlags · Issue #487 · dotnet/maui (original) (raw)

Accessibility Grouping and Behavior

The API's discussed here are currently just a spike of behavior that we want.

AccessibilityLeafHint

With accessibility you need the ability to have more control over the grouping behavior of AccessibilityBranches

For example given the following layout

The app developer will want to provide a single help text to be read on the StackLayout and for the rest of the inner elements not to participate in the accessibility process

public enum AccessibilityLeafHint { Default, // act normal Remove, // remove this node and all of the children RemoveChildren, //keep this node but remove children Keep, // if this is being removed by a parent hint then add this node (without children) back onto the tree KeepWithChildren // if this is being removed by a parent hint then add this node and all my children back in }

API

public class Accessibility { public AccessibilityLeafHint LeafHint //Attached Property }

Accessibility Interaction

Provide the ability to indicate what will trigger an element

API

[Flags] public enum AccessibilityInteraction { Default, SingleTap, LongPress }

public class Accessibility { public AccessibilityInteraction Interaction //Attached Property }

Accessibility Checkability

This will cause an element to act like a switch or a checkbox with regards to accessibility.

public class Accessibility { public bool IsChecked //Attached Property public bool IsCheckable //Attached Property }

Scenarios

// TODO

XAML Example

Difficulty : high