public override XamlType GetXamlType(Type type)
        {
            type.CheckNotNull("type");
            XamlType result;

            if (!_types.TryGetValue(type, out result))
            {
                ICustomTypeDescriptor descriptor = GetTypeDescriptor(type);
                if (descriptor != null)
                {
                    result = new TypeDescriptorXamlType(type, this, descriptor);
                }
                if (!_types.TryAdd(type, result))
                {
                    result = _types[type];
                }
            }
            return(result ?? base.GetXamlType(type));
        }
        public override XamlType GetXamlType(Type type)
        {
            type.CheckNotNull("type");
            XamlType result;
            if (!_types.TryGetValue(type, out result))
            {
                ICustomTypeDescriptor descriptor = GetTypeDescriptor(type);
                if (descriptor != null)
                {
                    result = new TypeDescriptorXamlType(type, this, descriptor);

                }
                if (!_types.TryAdd(type, result))
                {
                    result = _types[type];
                }
            }
            return result ?? base.GetXamlType(type);
        }
 public TypeDescriptorXamlTypeInvoker(TypeDescriptorXamlType xamlType)
     : base(xamlType)
 {
     this.Type = xamlType.UnderlyingType;
 }
 public TypeDescriptorXamlTypeInvoker(TypeDescriptorXamlType xamlType)
     : base(xamlType)
 {
     this.Type = xamlType.UnderlyingType;
 }