Back to Devexpress

TreeListNodeAutomationEventArgs Class

wpf-devexpress-dot-xpf-dot-grid-dot-treelist-a95838b9.md

latest2.9 KB
Original Source

TreeListNodeAutomationEventArgs Class

Stores data for the AutomationRequested attached event when the target tree node is focused.

Namespace : DevExpress.Xpf.Grid.TreeList

Assembly : DevExpress.Xpf.Grid.v25.2.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public class TreeListNodeAutomationEventArgs :
    AutomationEventArgs
vb
Public Class TreeListNodeAutomationEventArgs
    Inherits AutomationEventArgs

Remarks

Use the TreeListNodeAutomationEventArgs class to read or modify values announced by screen readers when the target tree list node is focused.

The AutomationRequested attached event allows you to change default values announced by third-party screen readers. The event fires for a tree list node when a TreeListControl (or a related control) requests a UI automation value for a focused node.

Example

The following code example handles the AutomationRequested event and changes values announced by a screen reader when the target node is focused:

xaml
<dxg:TreeListControl ItemsSource="{Binding Categories}">
    <dxg:TreeListControl.View>
        <dxg:TreeListView
        dxg:GridAutomationHelper.AutomationRequested="OnAutomationRequested"/>
    </dxg:TreeListControl.View>
</dxg:TreeListControl>
csharp
using DevExpress.Xpf.Grid.TreeList;
using DevExpress.Xpf.Grid.Automation;

void OnAutomationRequested(object sender, AutomationEventArgs e) {
    if (e is TreeListNodeAutomationEventArgs args) {
        // Example: use a property from the bound data object
        if (args.Row is Category item && !string.IsNullOrEmpty(item.Title)) {
            e.AutomationValue = $"Category {item.Title}";
        }
    }
}

Inheritance

Object EventArgs RoutedEventArgs AutomationEventArgs TreeListNodeAutomationEventArgs

See Also

TreeListNodeAutomationEventArgs Members

DevExpress.Xpf.Grid.TreeList Namespace