Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
AutomationPropertyChangedEventArgs Constructor

AutomationPropertyChangedEventArgs Constructor

Initializes a new instance of the AutomationPropertyChangedEventArgs class.

Namespace:  System.Windows.Automation
Assembly:  UIAutomationTypes (in UIAutomationTypes.dll)

public AutomationPropertyChangedEventArgs(
	AutomationProperty property,
	Object oldValue,
	Object newValue


Type: System.Windows.Automation.AutomationProperty

The identifier of the property that has changed.

Type: System.Object

The previous value of the property.

Type: System.Object

The new value of the property.

oldValue can be null (Nothing in Microsoft Visual Basic .NET) if the previous value is not readily available.

The following example constructs and raises an event when a property has changed.

/// <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

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft