Thursday, 26 May 2016

Xamarin.Forms Behaviors: New Actions

My Behaviors Library for Xamarin.Forms is a PCL I’ve created that can be consumed by Xamarin.Forms applications, and can be downloaded from GitHub and NuGet. The library has the notion of behaviors and actions. A behavior is attached to a control and listens for something to happen, such as an event firing. When the “something” happens, it triggers one or more actions, such as invoking a method or command. Actions are invoked by behaviors and executed on a selected control.

I’ve recently added a number of new actions to the library, to support animations. The actions are:

  • FadeAction
  • RotateAction
  • ScaleAction
  • TranslateAction

The advantage of using these actions is that it’s possible to invoke animation through XAML, rather than having to use C#. In addition, when combined with behaviors, compound animations can easily be invoked through XAML when a behavior occurs, such as an event firing, or a piece of data changing.

Stay tuned over the next few weeks for details of how to consume these actions.

2 comments:

  1. Dave,

    You have great back links in this series, but not forward, and so it is hard to work my way through. Since this is a brilliant set of articles, anything you can do to help would be great.

    Also, any chance you can post to Twitter when you add to the series?

    Thanks.

    ReplyDelete
  2. Hi Jesse,

    Thanks for your kind comments. If you go to my behaviours GitHub project (https://github.com/davidbritch/behaviors), the readme has links to the blog posts in the correct order.

    Yes, I'll post to Twitter as I expand the series.

    ReplyDelete