public override XamlType GetXamlType(Type type) { XamlType xamlType; if (typeCache.TryGetValue(type, out xamlType)) { return(xamlType); } var info = type.GetTypeInfo(); if ( info.IsSubclassOf(typeof(Widget)) || info.Assembly == EtoAssembly || // struct ( // nullable struct info.IsGenericType && info.GetGenericTypeDefinition() == typeof(Nullable <>) && Nullable.GetUnderlyingType(type).GetTypeInfo().Assembly == EtoAssembly )) { xamlType = new EtoXamlType(type, this); typeCache.Add(type, xamlType); return(xamlType); } return(base.GetXamlType(type)); }
public override XamlType GetXamlType(Type type) { if (type.Assembly == typeof(Platform).Assembly) { XamlType xamlType; if (!typeCache.TryGetValue(type, out xamlType)) { xamlType = new EtoXamlType(type, this); typeCache.Add(type, xamlType); } return(xamlType); } return(base.GetXamlType(type)); }
public override XamlType GetXamlType(Type type) { // Use EtoXamlType for all types on mono so we can override incorrect behavior when getting collection // item types in EtoItemType.LookupItemType if (EtoEnvironment.Platform.IsMono || type.Assembly == typeof(Platform).Assembly) { XamlType xamlType; if (typeCache.TryGetValue(type, out xamlType)) { return(xamlType); } xamlType = new EtoXamlType(type, this); typeCache.Add(type, xamlType); return(xamlType); } return(base.GetXamlType(type)); }