OmniXAML/README.md

68 строки
3.0 KiB
Markdown
Исходник Обычный вид История

2016-02-21 23:20:41 +03:00
Get the latest nighly NuGet packages with this NuGet feed! https://www.myget.org/F/omnixaml/api/v2
2015-06-21 18:04:37 +03:00
# OmniXAML
## The Cross-platform XAML Framework.
2015-02-24 21:58:41 +03:00
2015-06-25 12:59:59 +03:00
[![Join the chat at https://gitter.im/SuperJMN/OmniXAML](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/SuperJMN/OmniXAML?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2016-02-21 23:20:41 +03:00
[![Build status](https://ci.appveyor.com/api/projects/status/yyryrdbik5snckqh?svg=true)](https://ci.appveyor.com/project/SuperJMN/omnixaml)
2015-06-25 12:59:59 +03:00
2015-06-13 17:00:48 +03:00
*I know you need it, I know you want it. I know you XAML!*
2015-02-24 21:58:41 +03:00
2015-06-21 18:04:37 +03:00
![Sample](https://cloud.githubusercontent.com/assets/3109851/8272107/1af21840-1837-11e5-85d5-e61c7c8e9679.png "Test Application")
2016-02-21 23:20:41 +03:00
2015-06-21 18:04:37 +03:00
**OmniXAML is a library that allows you interpret XAML with ease. You can read XAML and get the object it represents, like a Window in WPF, a document, a diagram or whatever object you can describe.**
2015-11-10 12:50:49 +03:00
In its current state it's able to interpret quite complex XAML without problems.
It complies with most of the features that XAML provides, except for some uncommon/advanced features like:
- x:Class directive
- x:TypeArguments
- x:Shared
2015-11-10 12:51:19 +03:00
It also lacks support for events.
OmniXAML doesn't generate compiled XAML, so no intermediate format is produced. Since it's designed to be cross-platform, it doesn't rely on extra build steps. This means that right, in order to have access to named elements (x:Name/Name) you will have to use namescopes, for instance `window.Find(nameOfControl)`.
2015-07-04 11:09:56 +03:00
# Using OmniXAML with WPF
2015-06-19 12:09:50 +03:00
It's super easy! Just follow this [simple guide](https://github.com/SuperJMN/OmniXAML/wiki/Using-OmniXAML-for-WPF).
2015-06-13 16:52:34 +03:00
# Sample XAML
The following an example of XAML that can be read with OmniXAML.
```xml
<Window Width="300" Height="300"
xmlns="perspex"
xmlns:m="clr-namespace:TestApplication;Assembly=TestApplication">
<ScrollViewer>
<StackPanel>
<ListBox Items="{Binding Path=People}">
<ListBox.DataTemplates>
<XamlDataTemplate DataType="{Type TypeName=m:Person}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Image Source="github_icon.png" Height="60" />
<Button Grid.Column="1" Content="{Binding Path=Name}" />
</Grid>
</XamlDataTemplate>
</ListBox.DataTemplates>
</ListBox>
</StackPanel>
</ScrollViewer>
</Window>
2015-06-13 16:57:10 +03:00
```
This project is linked with [Perspex, the next-generation WPF](https://github.com/grokys/Perspex).
2015-04-14 15:27:34 +03:00
2015-05-20 19:07:14 +03:00
Thanks to [Nicholas Blumhardt](https://twitter.com/nblumhardt) for his awesome project [Sprache](https://github.com/sprache/Sprache) that has introduced me in the world of parsers.
2015-06-13 17:01:59 +03:00
```csharp
foreach (var thing in life)
{
world.Shout(string.Format("XAML is the best language to describe {0}", thing);
}
```
2016-02-21 23:20:41 +03:00