AutomationPropertyChangedEventArgs Constructor
Collapse the table of content
Expand the table of content

AutomationPropertyChangedEventArgs Constructor (AutomationProperty, Object, Object)

 

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
)

Parameters

property
Type: System.Windows.Automation.AutomationProperty

The identifier of the property that has changed.

oldValue
Type: System.Object

The previous value of the property.

newValue
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
Available since 3.0
Return to top
Show:
© 2016 Microsoft