Browse Source
Merge pull request #5495 from MarchingCube/parse-class
Parse classes during XAML compilation.
pull/5507/head
Nikita Tsukanov
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
12 additions and
1 deletions
-
src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/AvaloniaXamlIlLanguageParseIntrinsics.cs
-
src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/Transformers/AvaloniaXamlIlWellKnownTypes.cs
-
src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github
|
|
|
@ -198,6 +198,15 @@ namespace Avalonia.Markup.Xaml.XamlIl.CompilerExtensions |
|
|
|
return ConvertDefinitionList(node, text, types, types.RowDefinitions, types.RowDefinition, "row definitions", out result); |
|
|
|
} |
|
|
|
|
|
|
|
if (type.Equals(types.Classes)) |
|
|
|
{ |
|
|
|
var classes = text.Split(' '); |
|
|
|
var classNodes = classes.Select(c => new XamlAstTextNode(node, c, types.XamlIlTypes.String)).ToArray(); |
|
|
|
|
|
|
|
result = new AvaloniaXamlIlAvaloniaListConstantAstNode(node, types, types.Classes, types.XamlIlTypes.String, classNodes); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
result = null; |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
@ -77,6 +77,7 @@ namespace Avalonia.Markup.Xaml.XamlIl.CompilerExtensions.Transformers |
|
|
|
public IXamlType RowDefinitions { get; } |
|
|
|
public IXamlType ColumnDefinition { get; } |
|
|
|
public IXamlType ColumnDefinitions { get; } |
|
|
|
public IXamlType Classes { get; } |
|
|
|
|
|
|
|
public AvaloniaXamlIlWellKnownTypes(TransformerConfiguration cfg) |
|
|
|
{ |
|
|
|
@ -166,6 +167,7 @@ namespace Avalonia.Markup.Xaml.XamlIl.CompilerExtensions.Transformers |
|
|
|
ColumnDefinitions = cfg.TypeSystem.GetType("Avalonia.Controls.ColumnDefinitions"); |
|
|
|
RowDefinition = cfg.TypeSystem.GetType("Avalonia.Controls.RowDefinition"); |
|
|
|
RowDefinitions = cfg.TypeSystem.GetType("Avalonia.Controls.RowDefinitions"); |
|
|
|
Classes = cfg.TypeSystem.GetType("Avalonia.Controls.Classes"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1 +1 @@ |
|
|
|
Subproject commit ea80a607c5e9d8f000160dbbb48c27ed4cfafbc9 |
|
|
|
Subproject commit f3ca2028f4f64be3556a6afd22f192902de095e5 |