다음을 통해 공유


AutomationInteropProvider.RaiseAutomationPropertyChangedEvent 메서드

정의

UI 자동화 속성이 변경되면 이벤트를 발생합니다.

public:
 static void RaiseAutomationPropertyChangedEvent(System::Windows::Automation::Provider::IRawElementProviderSimple ^ element, System::Windows::Automation::AutomationPropertyChangedEventArgs ^ e);
public static void RaiseAutomationPropertyChangedEvent (System.Windows.Automation.Provider.IRawElementProviderSimple element, System.Windows.Automation.AutomationPropertyChangedEventArgs e);
static member RaiseAutomationPropertyChangedEvent : System.Windows.Automation.Provider.IRawElementProviderSimple * System.Windows.Automation.AutomationPropertyChangedEventArgs -> unit
Public Shared Sub RaiseAutomationPropertyChangedEvent (element As IRawElementProviderSimple, e As AutomationPropertyChangedEventArgs)

매개 변수

element
IRawElementProviderSimple

이벤트와 연결된 요소입니다.

e
AutomationPropertyChangedEventArgs

이벤트 정보입니다.

예제

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

적용 대상

추가 정보