AutomationInteropProvider.RaiseAutomationPropertyChangedEvent Method (IRawElementProviderSimple, AutomationPropertyChangedEventArgs)

 

Raises an event when a UI Automation property has changed. 

Namespace:   System.Windows.Automation.Provider
Assembly:  UIAutomationProvider (in UIAutomationProvider.dll)

public static void RaiseAutomationPropertyChangedEvent(
	IRawElementProviderSimple element,
	AutomationPropertyChangedEventArgs e
)

Parameters

element
Type: System.Windows.Automation.Provider.IRawElementProviderSimple

The element associated with the event.

e
Type: System.Windows.Automation.AutomationPropertyChangedEventArgs

Information about the event.

/// <summary>
/// Raises an event when the IsEnabled property on a control is changed.
/// </summary>
/// <param name="provider">The UI Automation provider for the control.</param>
/// <param name="newValue">The current enabled state.</param>
private void RaiseEnabledEvent(IRawElementProviderSimple provider, bool newValue)
{
    if (AutomationInteropProvider.ClientsAreListening)
    {
        AutomationPropertyChangedEventArgs args =
            new AutomationPropertyChangedEventArgs(AutomationElement.IsEnabledProperty,
                !newValue, newValue);
        AutomationInteropProvider.RaiseAutomationPropertyChangedEvent(provider, args);
    }
}

.NET Framework
Available since 3.0
Return to top
Show: