Julien Lebosquain
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
9 additions and
1 deletions
-
src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/Transformers/AvaloniaXamlIlDeferredResourceTransformer.cs
|
|
|
@ -43,9 +43,17 @@ namespace Avalonia.Markup.Xaml.XamlIl.CompilerExtensions.Transformers |
|
|
|
|
|
|
|
private static bool ShouldBeDeferred(IXamlAstValueNode node) |
|
|
|
{ |
|
|
|
var clrType = node.Type.GetClrType(); |
|
|
|
|
|
|
|
// XAML compiler is currently strict about value types, allowing them to be created only through converters.
|
|
|
|
// At the moment it should be safe to not defer structs.
|
|
|
|
if (node.Type.GetClrType().IsValueType) |
|
|
|
if (clrType.IsValueType) |
|
|
|
{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
// Never defer strings.
|
|
|
|
if (clrType.FullName == "System.String") |
|
|
|
{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
|