Export (0) Print
Expand All

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

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft