Xamarin.Forms - Numeric validation behavior with style

Xamarin.Forms behaviors can be consumed by an explicit or implicit style. This sample demonstrates how to consume a Xamarin.Forms behavior with an explicit style.

        <Style x:Key="NumericValidationStyle" TargetType="Entry">
                <Setter Property="local:NumericValidationBehavior.AttachBehavior" Value="true" />
<StackLayout Padding="10,50,10,0">
    <Label Text="Red when the number isn't valid" FontSize="Small" />
    <Entry Placeholder="Enter a System.Double" Style="{StaticResource NumericValidationStyle}" />

NumericValidation Behavior with Style application screenshot

For more information about this sample, see Behaviors.