Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

AutomationInteropProvider.RaiseAutomationPropertyChangedEvent Method

Definition

Namespace:
System.Windows.Automation.Provider
Assembly:
UIAutomationProvider.dll

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Raises an event when a UI Automation property has changed.

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)

Parameters

element
IRawElementProviderSimple

The element associated with the event.

e
AutomationPropertyChangedEventArgs

Information about the event.

Examples

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

Applies to

See also


Feedback

Was this page helpful?