Net Maui CollectionView, Image Source

2023-03-26T13:22:06.6733333+00:00

I have a CollectionView in .Net Maui, and this collectionview has items as Label and Image, ImageSource i am getting from URL, also I have bottom tabs, and when I am switching tabs and come back to parent tab, all images are lost in collectionview

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
1,441 questions
{count} votes

Accepted answer
  1. Sedat SALMAN 5,635 Reputation points
    2023-03-26T13:51:30.09+00:00

    preserve the view state when switching tabs. To do this, override the OnDisappearing and OnAppearing methods in the parent page of the CollectionView:

    check

    
    protected override void OnDisappearing()
    {
        base.OnDisappearing();
        // Save the view state (e.g., the CollectionView's content)
    }
    
    protected override void OnAppearing()
    {
        base.OnAppearing();
        // Restore the view state (e.g., load the CollectionView's content)
    }
    
    
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful