I have a Listview in Xamarin Forms. The content of every cell in list is text and one or more images. I search way to detect when all content in cell is finish loading. My idea is using a IsLoading property of Image. Source of images are urls http.
This is the code of the FlexLayout where the list of images is loaded:
<FlexLayout AlignContent="Center" AlignItems="Center" Direction="Row" JustifyContent="Center" Wrap="Wrap" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" x:Name="media" Grid.Row="1" Margin="0,10,0,10" BindableLayout.ItemsSource="{Binding Media}">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Image x:Name="img" Source ="{Binding Url}" HeightRequest="{Binding ListHeigth}" WidthRequest="{Binding ListWidth}" Aspect="AspectFit" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" />
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
I have not found a way to Binding the IsLoading property using the XAML. Being a list, I don't know how to use this property in each of the elements:
img.PropertyChanged += (sender, args) =>
{
if (args.PropertyName == "IsLoading")
{
//do somink
}
};
How is the IsLoading property Binding in the Xaml? Or is there some other callback to detect that all the content of the cell has been loaded?
Thanks a lot.