Actually I want to bind my IValueConverter with the StackLayout the code behind is
There's my ListView in CommentsPage i.e.,
public class CommentsPage : ContentPage
{
_commentsList.ItemTemplate = new DataTemplate(typeof(CommentsCell));
}
Also there's my CommentsCell that's another class .
public class CommentsCell : ViewCell
{
ContentView mainLayout = new ContentView
{
Padding = new Thickness(1,0,1,0),
BackgroundColor = Color.White,
HorizontalOptions = LayoutOptions.StartAndExpand,
VerticalOptions = LayoutOptions.StartAndExpand,
WidthRequest = _screenWidth
};
mainLayout.SetBinding(VisualElement.BackgroundColorProperty, new Binding(".", BindingMode.Default, new isFirstOrLastColorConverter(),
MyItemsListView));
}
Now the question is how to access the following binding there in CommentsCell Class ?
mainLayout.SetBinding(VisualElement.BackgroundColorProperty, new Binding(".", BindingMode.Default, new isFirstOrLastColorConverter(),
MyItemsListView));