Portable .NET library for reading/writing xaml files.
Перейти к файлу
Curtis Wensley ab55261737
Merge pull request #137 from wieslawsoltes/UpdateBenchmarkProject
Update benchmark project
2018-12-05 10:15:45 -08:00
build Fix branch name 2018-11-20 11:09:02 -08:00
src Updated benchamark project 2018-12-05 17:28:53 +01:00
.gitattributes Add .gitattributes to normalize line endings 2015-10-08 21:20:20 -07:00
.gitignore Update .gitignore 2018-12-05 17:25:10 +01:00
Directory.Build.props Use PackageReference for everything 2018-01-20 20:21:55 -08:00
Directory.Build.targets Updates for using system TypeConverter 2018-01-20 19:41:39 -08:00
LICENSE.txt - Move projects into their own directory to support using nuget properly 2015-09-28 23:03:48 -07:00
NuGet.Config Use PackageReference for everything 2018-01-20 20:21:55 -08:00
README.md Update README.md 2018-11-23 16:08:58 +01:00
appveyor.yml Updating to 0.24.0 2018-11-20 11:12:28 -08:00
build.cmd Update build to generate versioned packages on appveyor 2018-01-25 00:30:12 -08:00
build.sh Update build to generate versioned packages on appveyor 2018-01-25 00:30:12 -08:00

README.md

Portable.Xaml is a fork of mono's System.Xaml converted to .NET Standard.

This is intended to be used to read and write XAML on desktop, mobile, and .NET Core platforms.

Join the chat at https://gitter.im/cwensley/Portable.Xaml Build status

Supported Profiles

Portable.Xaml currently supports the following profiles:

  • .NET Standard 1.0 - For .NET 4.5
  • .NET Standard 1.3 - For .NET 4.6, .NET Core, UWP, Xamarin, etc.

Other profiles can be contributed if desired, but these should support the widest range of platforms.

Downloads

The primary way to use Portable.Xaml is by adding the nuget package to your project.

To get daily builds, add the appveyor feed to your nuget package sources. Make sure you check 'include prerelease' to show the prerelease builds.

Goals

The goal of this library is not necessarily to replicate the functionality of System.Xaml going forward, so breaking changes may occur, but only when necessary to keep migrating to Portable.Xaml straightforward.

Some of the enhanced functionality of Portable.Xaml include (but not limited to):

  • Supports System.Collections.Immutable collections and dictionaries.
  • Automatic support for immutable types (with no default constructor) without having to use x:Arguments by using properties flagged with [ConstructorArgumentAttribute] automatically.
  • Easier to override XamlMember creation using ParameterInfo/PropertyInfo/MethodInfo/etc from XamlSchemaContext
  • TypeConverter is used for items when adding to any ICollection<T> inherited list, if the type does not match.

Project Status

While this library should be usable to read & write XAML files including markup extensions, it may have some bugs.

Contributors are more than welcome! Ideally this library can become well supported to bring XAML to more applications.

Performance

What about performance you ask? Portable.Xaml's performance has been drastically improved over mono's initial implementation, and is actually much faster than .NET's System.Xaml in most cases.

Here's some results using BenchmarkDotNet:

Load

Method Mean StdDev Op/s Scaled Gen 0 Allocated
PortableXaml 569.8 us 16.294 us 1,754.9 1.00 11.7188 50.56 KB
SystemXaml 1,325.2 us 11.485 us 754.6 2.33 35.1563 151.53 KB
PortableXamlNoCache 1,409.3 us 7.649 us 709.6 2.48 25.3906 106.38 KB
SystemXamlNoCache 1,892.2 us 28.304 us 528.5 3.32 44.9219 184.67 KB
OmniXamlBenchmark 8,095.5 us 310.062 us 123.5 14.22 406.2500 1689.29 KB

Save

Method Mean StdDev Op/s Scaled Gen 0 Allocated
PortableXaml 481.8 us 2.805 us 2,075.4 1.00 26.8555 110.4 KB
SystemXaml 809.2 us 12.997 us 1,235.8 1.68 28.3203 117.2 KB
PortableXamlNoCache 1,060.2 us 34.809 us 943.3 2.20 33.2031 138.91 KB
SystemXamlNoCache 1,151.5 us 18.052 us 868.5 2.39 33.2031 139.17 KB

License

Portable.Xaml is licensed under MIT.