public bool IsMatch(AutomationElement element)
{
var actualObj = element.GetCurrentPropertyValue(Property);
// If the element's current property value is null or not a string object, return false.
if (actualObj == null || !(actualObj is string))
return false;
// Otherwise cast to strings...
var actual = (string) actualObj;
var expected = (string) Value;
// ... and compare them.
return Matcher.IsMatch(actual, expected);
}