XamlBehaviors/README.md

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

# **XAML Behaviors**
XAML Behaviors is an easy-to-use means of adding common and reusable interactivity to your Windows UWP applications with minimal code. It is available for both native and managed applications. Use of XAML Behaviors is governed by the MIT License
#Build Status
| Platform | Status |
| -------- | ------ |
| Managed | <img src="https://ci.appveyor.com/api/projects/status/0dptycdhhykyscr4/branch/master?svg=true"/> |
2016-01-23 02:43:24 +03:00
| Native | <img src="https://ci.appveyor.com/api/projects/status/897ervx359xqa7vh/branch/master?svg=true"/> |
Getting Started
-------------------
**Where to get it**
- NuGet package for [Native](https://www.nuget.org/packages/Microsoft.Xaml.Behaviors.Uwp.Native/) and [Managed](https://www.nuget.org/packages/Microsoft.Xaml.Behaviors.Uwp.Managed/)
- [Source Code](https://github.com/Microsoft/XamlBehaviors)
**Resources**
- [Documentation](https://github.com/Microsoft/XamlBehaviors/wiki)
- [Samples](/samples)
2016-01-21 04:08:50 +03:00
- [![Join the chat at https://gitter.im/Microsoft/XamlBehaviors](https://badges.gitter.im/Microsoft/XamlBehaviors.svg)](https://gitter.im/Microsoft/XamlBehaviors?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
**More Info**
- [Report a bug or ask a question](https://github.com/Microsoft/XamlBehaviors/issues)
- [Contribute](https://github.com/Microsoft/XamlBehaviors/wiki/Contribute-to-XAML-Behaviors)
- [License](http://opensource.org/licenses/MIT)
Code Example
------------
For an example of using Behaviors in an application, here is a snippet of XAML:
2015-09-03 00:43:40 +03:00
```xml
<Button>
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="Click">
<Core:ChangePropertyAction PropertyName="Background">
<Core:ChangePropertyAction.Value>
<SolidColorBrush Color="Red"/>
</Core:ChangePropertyAction.Value>
</Core:ChangePropertyAction>
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</Button>
2015-09-03 00:43:40 +03:00
```
Using Behaviors SDK
-------------------
The [documentation](https://github.com/Microsoft/XamlBehaviors/wiki) explains how to install Visual Studio, add the XAML Behaviors NuGet package to your project, and get started using the API.
Building Behaviors from Source
------------------------------
**What You Need**
- [Visual Studio 2015 Update 1 w/ Universal Windows Tools](https://www.visualstudio.com/features/windows-apps-games-vs)
**Clone the Repository**
-Go to 'View' -> 'Team Explorer' -> 'Local Git Repositories' -> 'Clone'
-Add the XAML Behaviors repository URL (https://github.com/Microsoft/XamlBehaviors) and hit 'Clone'
**Build and Create Managed XAML Behaviors NuGet**
- Open the "BehaviorsSDKManaged.sln" solution in Visual Studio
- Change Build Configuration to Release
- Build [Ctrl + B]
- Install the latest NuGet command-line tool by running **scripts/download-nuget.cmd**
- Run **scripts/CreateManagedNuGet.cmd**
**Build and Create Native XAML Behaviors NuGet**
- Open the "BehaviorsSDKNative.sln" solution in Visual Studio
- [Batch Build](https://msdn.microsoft.com/en-us/library/169az28z(v=vs.90).aspx) for x86, x64, and ARM in Release
- Install the latest NuGet command-line tool by running **scripts/download-nuget.cmd**
- Run **scripts/CreateNativeNuGet.cmd**