private bool TryGetBamlType(Int16 typeId, out BamlType bamlType, out XamlType xamlType) { bamlType = null; xamlType = null; lock (_syncObject) { if (typeId >= 0 && typeId < _bamlType.Count) { object type = _bamlType[typeId]; bamlType = type as BamlType; xamlType = type as XamlType; return(type != null); } } if (typeId < 0) { if (_parentSchemaContext == System.Windows.Markup.XamlReader.BamlSharedSchemaContext) { xamlType = System.Windows.Markup.XamlReader.BamlSharedSchemaContext.GetKnownBamlType(typeId); } else { xamlType = _parentSchemaContext.GetXamlType(KnownTypes.GetKnownType(typeId)); } return(true); } return(bamlType != null); }