/// <summary> /// Fire the element focused event. /// </summary> /// <param name="element"></param> internal static void fireElementFocused(RocketWidget rocketWidget, Element element) { if (ElementFocused != null) { ElementFocused.Invoke(rocketWidget, element); } }
private void OnFocusChanged(AutomationElement automationElement) { // Skip items in the current process // Like Inspect itself or the overlay window if (automationElement.Properties.ProcessId == Process.GetCurrentProcess().Id) { return; } if (!Equals(_currentFocusedElement, automationElement)) { _currentFocusedElement = automationElement; System.Windows.Application.Current.Dispatcher.Invoke(() => { ElementFocused?.Invoke(automationElement); }); } }