PropertyCondition Constructor (AutomationProperty, Object)


Initializes a new instance of the PropertyCondition class.

Namespace:   System.Windows.Automation
Assembly:  UIAutomationClient (in UIAutomationClient.dll)

public PropertyCondition(
	AutomationProperty property,
	object value


Type: System.Windows.Automation.AutomationProperty

The property to test.

Type: System.Object

The value to test the property for.

The property parameter cannot be BoundingRectangleProperty.

In the following example, a PropertyCondition specifies that the UI Automation element to be found has a control type of List. The PropertyCondition is then used to obtain the list element from a combo box.

Condition propCondition1 = new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.List);
AutomationElement listElement = elementCombo.FindFirst(TreeScope.Children, propCondition1);

.NET Framework
Available since 3.0
Return to top