Delpin Susai Raj Monday, 3 February 2020

Xamarin.Forms - Use BindableProperty in Effects

In this blog, you will learn how to use BindableProperty Effects in Xamarin.Forms

Tint Color Sample -

(The Blog about change Image color at Runtime using Tint Color)


Xamarin.Forms code runs on multiple platforms - each of which has its own filesystem. This means that reading and writing files are most easily done using the native file APIs on each platform. Alternatively, embedded resources are a simpler solution to distribute data files with an app.

Tint Image

TintImage is used for change image color at runtime with the help of effects, you can achieve with custom render also. Tint images mainly used to reduce the usage of the images.


Attached properties can be used to define effect parameters that respond to runtime property changes. This article demonstrates using attached properties to pass parameters to an effect and changing a parameter at runtime.

  • Visual Studio 2017 or later (Windows or Mac)
The Problem

We are not able to create a BindableProperty in Effect.


Create Effect

Now, Create a TintImage class inherit from RoutingEffect for Change image color.


Create Static Class

Here, I'm Going to create a Static Class for creating BindableProperty to my Effect.


Android Implementation

Here, Implement Platform Effects for TintImage at Runtime.


iOS Implementation

Here, Implement Platform Effects for TintImage at Runtime.


Create ViewModel

Now, Create a Property for Binding the TintColor to View. and Create ChangeColorCommand For Change image color at runtime.


Consuming the TintImage

Now, Use the TintImage Effect in your XAML code.


Click the "Play" button to try it out.

Wow, It's Working.😍

I hope you have understood how to use BindableProperty Effects in Xamarin.Forms.

Thanks for reading. Please share your comments and feedback. Happy Coding 🙌