AutomationPropertyChangedEventArgs(AutomationProperty, Object, Object) 생성자

정의

AutomationPropertyChangedEventArgs 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the AutomationPropertyChangedEventArgs class.

public:
 AutomationPropertyChangedEventArgs(System::Windows::Automation::AutomationProperty ^ property, System::Object ^ oldValue, System::Object ^ newValue);
public AutomationPropertyChangedEventArgs (System.Windows.Automation.AutomationProperty property, object oldValue, object newValue);
new System.Windows.Automation.AutomationPropertyChangedEventArgs : System.Windows.Automation.AutomationProperty * obj * obj -> System.Windows.Automation.AutomationPropertyChangedEventArgs
Public Sub New (property As AutomationProperty, oldValue As Object, newValue As Object)

매개 변수

property
AutomationProperty

변경된 속성의 식별자입니다.The identifier of the property that has changed.

oldValue
Object

이전 속성 값입니다.The previous value of the property.

newValue
Object

속성의 새 값입니다.The new value of the property.

예제

다음 예제에서는 생성 하 고는 속성이 변경 되 면 이벤트를 발생 시킵니다.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);
    }
}
''' <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 Sub RaiseEnabledEvent(ByVal provider As IRawElementProviderSimple, ByVal newValue As Boolean) 
    If AutomationInteropProvider.ClientsAreListening Then
        Dim args As New AutomationPropertyChangedEventArgs(AutomationElement.IsEnabledProperty, Not newValue, newValue)
        AutomationInteropProvider.RaiseAutomationPropertyChangedEvent(provider, args)
    End If

End Sub

설명

oldValue 일 수 있습니다 null (Nothing Visual Basic에서) 이전 값을 쉽게 사용할 수 없는 경우.oldValue can be null (Nothing in Visual Basic) if the previous value is not readily available.

적용 대상