Problem whit AutomationElement

Feb 20, 2015 at 4:29 PM
When try to instance an Automation element the system throw an error.

Code:
AutomationElement elem = win.Get(SearchCriteria.ByNativeProperty(AutomationElement.AutomationIdProperty, "mainGrid")).AutomationElement;

or

unlock = (Button)window.Get(SearchCriteria.ByText("Logout"));
AutomationElement elem = unlock.AutomationElement;


Error:
Error 39 Argument 1: cannot convert from 'System.Windows.Automation.AutomationProperty [c:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies\UIAComWrapper.dll]' to 'System.Windows.Automation.AutomationProperty' C:\csriii\COPsync.Client.AutomationTest\Objects\AVLObject.cs 15 78 COPsync.Client.AutomationTest

I need help