title: Windows UIAutomation creating PropertyCondition
body: <p>I am porting some UI automation from the System.Windows.Automation API to the native UIAutomationClient API, and have run into what feels like a simple problem, but cannot find the solution.</p>
  
  <p>I need to find UI elements using code along these lines:</p>
  
  <pre><code>IUIAutomationElement namedElement = currentWindow.FindFirst(UIAutomationClient.TreeScope.TreeScope_Descendants, nameCondition);
  </code></pre>
  
  <p>Here, the nameCondition object should a IUIAutomationCondition to compare the name of the element to a string.</p>
  
  <p>Using the old System.Windows.Automation I would write this as:</p>
  
  <pre><code>PropertyCondition nameCondition = new PropertyCondition(AutomationElement.NameProperty, "name");
  </code></pre>
  
  <p>However, I cannot work out how to use the UIAutomation API to create a PropertyCondition. The only examples I have seen seem to suggest something along these lines:</p>
  
  <pre><code>IUIAutomationCondition nameCondition = cuiAutomation.CreatePropertyCondition(propertyIdName, "name");   
  </code></pre>
  
  <p>Here, propertyIdName should be an int representing the NameProperty. However, I cannot work out how to get the correct int here. I assume it must be somewhere in the UIAutomation API as a constant, but cannot find it.     </p>