Hi !
In my ContentView, there is a ListView that is assigned the ItemTapped command using the EventToCommandBehavior:
<ListView x:Name="ItemsView"
ItemTemplate="{StaticResource DataTemplate.JobObject}"
ItemsSource="{Binding DayInfo.Items}"
RowHeight="{Binding ItemHeight}"
HeightRequest="{Binding ColumnHeight}">
<ListView.Behaviors>
<behaviors:EventToCommandBehavior EventName="ItemSelected"
Command="{Binding ItemTappedCommand}"
EventArgsConverter="{StaticResource SelectedItemConverter}"/>
</ListView.Behaviors>
</ListView>
Then I created a BindableProperty in ContentView that links my command:
public static readonly BindableProperty ItemTappedCommandProperty = BindableProperty.Create(
"ItemTappedCommand",
typeof(ICommand),
typeof(ColumnView));
public ICommand ItemTappedCommand
{
get => (ICommand) GetValue(ItemTappedCommandProperty);
set => SetValue(ItemTappedCommandProperty, value);
}
But when I try to link a property from ContentPage then my CommandProperty always is null. I tried to process the command in this ContentView and everything works fine, but the binding does not work.