Skip to main content
All docs
V25.2
  • GridAutomationHelper.RemoveAutomationRequestedHandler(DependencyObject, RoutedEventHandler) Method

    Removes an event handler that was previously added to the AutomationRequested attached event using the AddAutomationRequestedHandler(DependencyObject, RoutedEventHandler) method.

    Namespace: DevExpress.Xpf.Grid.Automation

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

    Declaration

    public static void RemoveAutomationRequestedHandler(
        DependencyObject dependencyObject,
        RoutedEventHandler handler
    )

    Parameters

    Name Type Description
    dependencyObject DependencyObject

    An object that stores the event handler.

    handler RoutedEventHandler

    An event handler that was previously added using the AddAutomationRequestedHandler(DependencyObject, RoutedEventHandler) method.

    Remarks

    Use the RemoveAutomationRequestedHandler method to unsubscribe from the AutomationRequested attached event:

    using System.Windows;
    using DevExpress.Xpf.Grid;
    using DevExpress.Xpf.Grid.Automation;
    
    public partial class MainWindow : Window {
        public MainWindow() {
            InitializeComponent();
            Loaded   += OnLoaded;
            Unloaded += OnUnloaded;
        }
    
        void OnLoaded(object sender, RoutedEventArgs e) {
            GridAutomationHelper.AddAutomationRequestedHandler(tableView, OnAutomationRequested);
        }
    
        void OnUnloaded(object sender, RoutedEventArgs e) {
            GridAutomationHelper.RemoveAutomationRequestedHandler(tableView, OnAutomationRequested);
        }
    
        void OnAutomationRequested(object sender, RoutedEventArgs e) {
            var args = (AutomationEventArgs)e;
            // Your args.AutomationValue customization code
        }
    }
    
    See Also