static ActionMessage CreateMessage(DependencyObject target, string messageText)
        {
            var message = new ActionMessage();

            messageText = Regex.Replace(messageText, "^Action", string.Empty);

            var openingParenthesisIndex = messageText.IndexOf('(');

            if (openingParenthesisIndex < 0)
            {
                openingParenthesisIndex = messageText.Length;
            }
            var closingParenthesisIndex = messageText.LastIndexOf(')');

            if (closingParenthesisIndex < 0)
            {
                closingParenthesisIndex = messageText.Length;
            }

            var core = messageText.Substring(0, openingParenthesisIndex).Trim();

            message.MethodName = core;

            if (closingParenthesisIndex - openingParenthesisIndex > 1)
            {
                var paramString = messageText.Substring(openingParenthesisIndex + 1,
                                                        closingParenthesisIndex - openingParenthesisIndex - 1);

                var parameters = Regex.Split(paramString);

                foreach (var parameter in parameters)
                {
                    message.Parameters.Add(CreateParameter(target, parameter.Trim()));
                }
            }

            return(message);
        }
 /// <summary>
 /// Makes the parameter aware of the <see cref="ActionMessage"/> that it's attached to.
 /// </summary>
 /// <param name="owner">The action message.</param>
 internal void MakeAwareOf(ActionMessage owner)
 {
     this.owner = owner;
 }