Automation.UI.Util.AutomationPropertyHelper.ProgrammaticName C# (CSharp) Method

ProgrammaticName() public static method

Gets the programmatic name for the specified automation property.
public static ProgrammaticName ( AutomationProperty property ) : string
property System.Windows.Automation.AutomationProperty The automation property.
return string
        public static string ProgrammaticName(AutomationProperty property)
        {
            var parts = property.ProgrammaticName.Split('.');
            return parts[parts.Length - 1].Replace("Property", "");
        }

Usage Example

        /// <summary>
        ///     Gets the string representation of the specified property condition.
        /// </summary>
        /// <param name="condition">The condition.</param>
        /// <returns>The string representation.</returns>
        private static string ToString(PropertyCondition condition)
        {
            var property = AutomationPropertyHelper.ProgrammaticName(condition.Property);
            var value    = condition.Value.ToString();

            return(property + "='" + value + "'");
        }
All Usage Examples Of Automation.UI.Util.AutomationPropertyHelper::ProgrammaticName