public static string GetUserFriendlyDescription(DocumentCompositeNode expressionNode, DocumentNode parentNode)
 {
     if (DocumentNodeUtilities.IsDynamicResource((DocumentNode)expressionNode) || DocumentNodeUtilities.IsStaticResource((DocumentNode)expressionNode))
     {
         DocumentNode          resourceKey           = ResourceNodeHelper.GetResourceKey(expressionNode);
         DocumentPrimitiveNode documentPrimitiveNode = resourceKey as DocumentPrimitiveNode;
         DocumentCompositeNode expressionNode1       = resourceKey as DocumentCompositeNode;
         if (documentPrimitiveNode != null && documentPrimitiveNode.Value != null)
         {
             return(documentPrimitiveNode.Value.ToString());
         }
         if (expressionNode1 != null && DocumentNodeUtilities.IsMarkupExtension((DocumentNode)expressionNode1))
         {
             return(XamlExpressionSerializer.GetUserFriendlyDescription(expressionNode1, (DocumentNode)expressionNode));
         }
     }
     else if (DocumentNodeUtilities.IsStaticResource((DocumentNode)expressionNode))
     {
         DocumentPrimitiveNode documentPrimitiveNode = expressionNode.Properties[StaticExtensionProperties.MemberProperty] as DocumentPrimitiveNode;
         if (documentPrimitiveNode != null)
         {
             return(documentPrimitiveNode.Value.ToString());
         }
     }
     return(XamlExpressionSerializer.GetStringFromExpression((DocumentNode)expressionNode, parentNode));
 }
 public static DocumentNode GetExpressionFromString(string text, DocumentNode parentNode, Type propertyType, out IList <XamlParseError> errors)
 {
     if (parentNode != null)
     {
         XamlDocument document = parentNode.DocumentRoot as XamlDocument;
         if (document != null)
         {
             return(XamlExpressionSerializer.GetExpressionFromString(text, document, parentNode, propertyType, out errors));
         }
     }
     errors = (IList <XamlParseError>)null;
     return((DocumentNode)null);
 }