Port of Windows UWP Xaml Behaviors for Avalonia Xaml.
Перейти к файлу
Wiesław Šoltés d45b886906
Create FUNDING.yml
2019-10-23 08:24:11 +02:00
.github Create FUNDING.yml 2019-10-23 08:24:11 +02:00
build Updated 2019-10-22 20:04:44 +02:00
samples Updated 2019-10-01 09:08:36 +00:00
src Updated 2019-10-01 09:08:36 +00:00
tests Updated 2019-10-01 09:08:36 +00:00
.editorconfig Updated editorconfig 2018-07-09 19:45:30 +02:00
.gitattributes Updated gitattributes and gitignore 2017-11-14 18:43:09 +01:00
.gitignore Use global .NET CLI tool 2018-08-22 22:14:01 +02:00
.nuke Updated Nuke 2019-03-25 15:17:56 +01:00
AvaloniaBehaviors.sln Updated 2019-10-01 09:08:36 +00:00
LICENSE.TXT Updated version 2019-04-04 05:59:29 +00:00
NuGet.Config Update NuGet.Config 2019-04-22 22:32:35 +02:00
README.md Update README.md 2018-12-11 23:21:21 +01:00
_config.yml Set theme jekyll-theme-cayman 2017-02-21 11:49:52 +01:00
build.ps1 Added nuke build support 2018-12-04 20:20:05 +01:00
build.sh Make executable 2018-12-04 20:29:09 +01:00
global.json Updated .NET Core version 2019-09-23 19:05:16 +02:00

README.md

Avalonia XAML Behaviors

Gitter

Build status

NuGet MyGet

AvaloniaBehaviors is a port of Windows UWP version of XAML Behaviors for Avalonia XAML.

Avalonia XAML Behaviors is an easy-to-use means of adding common and reusable interactivity to your Avalonia applications with minimal code. Avalonia port is available only for managed applications. Use of XAML Behaviors is governed by the MIT License.

Example Usage

Example of using Behaviors in an Avalonia XAML application:

<Window xmlns="https://github.com/avaloniaui"
        xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
        xmlns:ia="clr-namespace:Avalonia.Xaml.Interactions.Core;assembly=Avalonia.Xaml.Interactions"
        Width="500" Height="400">
    <Grid RowDefinitions="Auto,100">
        <TextBox Name="textBox" Text="Hello" Grid.Row="0" Margin="5"/>
        <Button Name="changePropertyButton" Content="Change Property" Grid.Row="1" Margin="5,0,5,5">
            <i:Interaction.Behaviors>
                <ia:EventTriggerBehavior EventName="Click" SourceObject="{Binding #changePropertyButton}">
                    <ia:ChangePropertyAction TargetObject="{Binding #textBox}" PropertyName="Text" Value="World"/>
                </ia:EventTriggerBehavior>
            </i:Interaction.Behaviors>
        </Button>
    </Grid>
</Window>

More examples can be found in sample application.

Building Avalonia XAML Behaviors

First, clone the repository or download the latest zip.

git clone https://github.com/wieslawsoltes/AvaloniaBehaviors.git
git submodule update --init --recursive

Build using IDE

Open AvaloniaBehaviors.sln in selected IDE and run Build command.

Build on Windows using script

Open up a command-prompt and execute the commands:

.\build.ps1

Build on Linux using script

Open up a terminal prompt and execute the commands:

./build.sh

Build on OSX using script

Open up a terminal prompt and execute the commands:

./build.sh

NuGet

Avalonia XamlBehaviors is delivered as a NuGet package.

You can find the packages here NuGet and install the package like this:

Install-Package Avalonia.Xaml.Behaviors

or by using nightly build feed:

  • Add https://www.myget.org/F/xamlbehaviors-nightly/api/v2 to your package sources
  • Update your package using XamlBehaviors feed

and install the package like this:

Install-Package Avalonia.Xaml.Behaviors -Pre

NuGet Packages

Package Dependencies

Package Sources

Resources

License

Avalonia XAML Behaviors is licensed under the MIT license.