Forum Xamarin.Forms


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

How to set Binding with IValue Converter and Padding ?

I've an IValue converter which returns Thickness Value . Now In my code behind I've a Layout which I want to bind with the Padding and IValueConverter.
Here's my code for the Background Color

mainLayout.SetBinding(VisualElement.BackgroundColorProperty, new Binding(".", BindingMode.Default, new IBackgroundConverter(), CommentsPage._commentsList));
In that control I've a Visual Element which is used to target the BackGroundColorProperty . Now come to the question that how to access the PaddingProperty in the above line .


  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    Sorry, I think your question is bit confuse.
    You ask about Padding and then you post BackgroundColorProperty...

  • Andrew1993Andrew1993 USMember ✭✭

    @AlessandroCaliaro thanks for the reply . I've found the answer .We can access the PaddingProperty with the help of Layout
    that is Layout.PaddingProperty
    just like VisualElement.BackgroundColorProperty .

Sign In or Register to comment.