Accessibility in .NET MAUI TreeMap (SfTreeMap)
17 Jul 20262 minutes to read
The .NET MAUI TreeMap (SfTreeMap) control supports keyboard navigation and provides accessible descriptions of its items for assistive technologies such as Narrator and VoiceOver. This topic covers the keyboard shortcuts available in the control and explains how selection behavior interacts with keyboard focus.
Keyboard navigation is enabled by default; no additional configuration is required to move focus between items. To interact with the control using the keyboard, first set focus on the TreeMap (for example, by clicking an item or by tabbing to the control from the previous focusable element). Keyboard shortcuts are supported on Windows and macOS only. On Android and iOS, the keyboard shortcuts have no effect and interaction is performed through touch gestures.
NOTE
Prerequisite: Ensure that the required NuGet package is installed, the necessary namespaces are imported, and the TreeMap control is properly configured in your application. For detailed setup and configuration instructions, refer to the Getting Started guide.
Keyboard shortcuts in .NET MAUI TreeMap (SfTreeMap)
The following table lists the keyboard shortcuts supported by the Syncfusion .NET MAUI TreeMap and their associated actions. Only Tab and Shift + Tab are supported; arrow-key navigation is not available.
|
Navigation shortcut keys |
Description |
|
Tab |
Moves focus to the next item in traversal order.
|
|
Shift + Tab |
Moves focus to the previous item in traversal order.
|
The item that receives keyboard focus is also visually highlighted. Whether the previously focused item remains selected after focus moves depends on the SelectionMode configured for the control; see Selection and highlights for details.
Selection behavior during keyboard navigation
The SelectionMode property of the SfTreeMap determines how items are selected while navigating with the keyboard:
- When
SelectionModeis Single, each key press moves focus to a new item and selects it, clearing the selection of the previously focused item. - When
SelectionModeis Multiple, each key press moves focus to a new item and adds it to the selection; previously selected items remain selected. - When
SelectionModeis None, focus can still be moved between items, but no item is selected.
<treemap:SfTreeMap x:Name="treeMap"
DataSource="{Binding PopulationDetails}"
PrimaryValuePath="Population"
SelectionMode="Single">
<!-- code omitted for brevity -->
</treemap:SfTreeMap>SfTreeMap treeMap = new SfTreeMap();
treeMap.DataSource = viewModel.PopulationDetails;
treeMap.PrimaryValuePath = "Population";
treeMap.SelectionMode = SelectionMode.Single;
//code omitted for brevity
this.Content = treeMap;