-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracted runtime XAML loader to a separate package
- Loading branch information
Showing
82 changed files
with
386 additions
and
464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<PackageOutputPath Condition="'$(PackageOutputPath)' == ''">$(MSBuildThisFileDirectory)build-intermediate/nuget</PackageOutputPath> | ||
<AvaloniaPreviewerNetCoreToolPath>$(MSBuildThisFileDirectory)\src\tools\Avalonia.Designer.HostApp\bin\$(Configuration)\netcoreapp2.0\Avalonia.Designer.HostApp.dll</AvaloniaPreviewerNetCoreToolPath> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 21 additions & 7 deletions
28
src/Avalonia.DesignerSupport/Remote/HtmlTransport/webapp/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/Markup/Avalonia.Markup.Xaml.Loader/Avalonia.Markup.Xaml.Loader.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<IsPackable>true</IsPackable> | ||
</PropertyGroup> | ||
<Import Project="IncludeXamlIlSre.props" /> | ||
<ItemGroup> | ||
<PackageReference Include="System.Reflection.Emit" Version="4.3.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Avalonia.Markup.Xaml\Avalonia.Markup.Xaml.csproj" /> | ||
</ItemGroup> | ||
</Project> |
42 changes: 42 additions & 0 deletions
42
src/Markup/Avalonia.Markup.Xaml.Loader/AvaloniaRuntimeXamlLoader.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.IO; | ||
using System.Reflection; | ||
using System.Text; | ||
using Avalonia.Markup.Xaml.XamlIl; | ||
// ReSharper disable CheckNamespace | ||
|
||
namespace Avalonia.Markup.Xaml | ||
{ | ||
public static class AvaloniaRuntimeXamlLoader | ||
{ | ||
/// <summary> | ||
/// Loads XAML from a string. | ||
/// </summary> | ||
/// <param name="xaml">The string containing the XAML.</param> | ||
/// <param name="localAssembly">Default assembly for clr-namespace:</param> | ||
/// <param name="rootInstance"> | ||
/// The optional instance into which the XAML should be loaded. | ||
/// </param> | ||
/// <returns>The loaded object.</returns> | ||
public static object Load(string xaml, Assembly localAssembly = null, object rootInstance = null, Uri uri = null, bool designMode = false) | ||
{ | ||
Contract.Requires<ArgumentNullException>(xaml != null); | ||
|
||
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(xaml))) | ||
{ | ||
return Load(stream, localAssembly, rootInstance, uri, designMode); | ||
} | ||
} | ||
|
||
public static object Load(Stream stream, Assembly localAssembly, object rootInstance = null, Uri uri = null, | ||
bool designMode = false) | ||
=> AvaloniaXamlIlRuntimeCompiler.Load(stream, localAssembly, rootInstance, uri, designMode); | ||
|
||
public static object Parse(string xaml, Assembly localAssembly = null) | ||
=> Load(xaml, localAssembly); | ||
|
||
public static T Parse<T>(string xaml, Assembly localAssembly = null) | ||
=> (T)Parse(xaml, localAssembly); | ||
|
||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
src/Markup/Avalonia.Markup.Xaml.Loader/IncludeXamlIlSre.props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project> | ||
<ItemGroup> | ||
<None Remove="$(MSBuildThisFileDirectory)\xamlil.github\**\*.*" /> | ||
<Content Remove="$(MSBuildThisFileDirectory)\xamlil.github\**\*.*" /> | ||
<Compile Remove="$(MSBuildThisFileDirectory)\xamlil.github\**\*.*" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\xamlil.github\src\XamlX\**\*.cs" /> | ||
<Compile Remove="$(MSBuildThisFileDirectory)\xamlil.github\**\obj\**\*.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\..\Avalonia.Markup\Markup\Parsers\SelectorGrammar.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\..\Avalonia.Markup.Xaml\Parsers\PropertyParser.cs" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\..\Avalonia.Markup\Markup\Parsers\BindingExpressionGrammar.cs" /> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.