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

Developer technologies | .NET | .NET MAUI
{count} votes

Accepted answer
  1. Sedat SALMAN 14,185 Reputation points MVP
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.