Example #1
0
        private static string ConvertTypeToString(ITypeDescriptorContext context, Type type)
        {
            var schemaContextProvider = GetService <IXamlSchemaContextProvider>(context);

            if (schemaContextProvider == null)
            {
                return(null);
            }
            if (schemaContextProvider.SchemaContext == null)
            {
                return(null);
            }
            XamlType xamlType = schemaContextProvider.SchemaContext.GetXamlType(type);

            if (xamlType == null)
            {
                return(null);
            }
            return(XamlTypeTypeConverter.ConvertXamlTypeToString(context, xamlType));
        }