title: Xamarin forms BoxView animation
body: <p>I'm trying to create a blinking BoxView. I created a BlinkingBoxView that extends BoxView and added 1 Boolean property called "Blink". So what I want is, every time Blink changes and it's value is true, I want to start the blinking animation, if the value is false stop the animation.</p>
  
  <p>Do I need to do this in C# code, or can I use only XAML like WPF?</p>
  
  <p>Here is my try...</p>
  
  <pre><code>public class BlinkingBoxView : BoxView
  {
      public BlinkingBoxView() 
          : base()
      {
  
      }
  
      public static readonly BindableProperty BlinkProperty = BindableProperty.Create&lt;BlinkingBoxView, bool&gt;(w =&gt; w.Blink, default(bool), BindingMode.TwoWay);
  
      public bool Blink
      {
          get { return (bool)GetValue(BlinkProperty); }
          set 
          {
              SetValue(BlinkProperty, value);
  
              var blinkAnimation = new Animation(d =&gt; this.FadeTo(0, 750, Easing.Linear)).WithConcurrent(new Animation(d =&gt; this.FadeTo(1, 750, Easing.Linear)));
  
              if (this.Blink)
                  this.Animate("Blink", blinkAnimation);
          }
      }
  }
  </code></pre>