public override IAutomationPropertyChangedEventHandler RegisterPropertyChangedEvent(TreeScope treeScope, Action <AutomationElement, PropertyId, object> action, PropertyId[] properties) { var eventHandler = new UIA2PropertyChangedEventHandler(Automation, action); UIA.Automation.AddAutomationPropertyChangedEventHandler(NativeElement, (UIA.TreeScope)treeScope, eventHandler.EventHandler); return(eventHandler); }
/// <inheritdoc /> public override PropertyChangedEventHandlerBase RegisterPropertyChangedEvent(TreeScope treeScope, Action <AutomationElement, PropertyId, object> action, PropertyId[] properties) { var eventHandler = new UIA2PropertyChangedEventHandler(this, action); UIA.Automation.AddAutomationPropertyChangedEventHandler(NativeElement, (UIA.TreeScope)treeScope, eventHandler.EventHandler, properties.Select(p => UIA.AutomationProperty.LookupById(p.Id)).ToArray()); return(eventHandler); }