Xamarin.Forms - Calling Factory Methods

This sample demonstrates using XAML to call a factory method that can be used to initialize an object.

For more information about this sample, see Passing Arguments in XAML.

Calling Factory Methods application screenshot

<BoxView HeightRequest="150" WidthRequest="150" HorizontalOptions="Center">
    <BoxView.Color>
        <Color x:FactoryMethod="FromRgba">
            <x:Arguments>
                <x:Int32>192</x:Int32>
                <x:Int32>75</x:Int32>
                <x:Int32>150</x:Int32>
                <x:Int32>128</x:Int32>
            </x:Arguments>
        </Color>
    </BoxView.Color>
</BoxView>