-2

I am loading about 20 to 100 images in a grid .

I am resizing it before loading on UI.

It works fine initially but crashes after 2 to 3 times navigation ( using Pushasync and Popasync)

Please help

protected async override void OnAppearing()
    {
        base.OnAppearing();
        try
        {
               await show_Thumbnail();
        }
        catch (Exception ex)
        {
            error=ex.Message;
        }}

I caught the exception but it doesn't show any exceptions but crashes the app.

Ejaz
  • 11
  • 2
  • Is there some kind of error message? Exception? Something in the output window? This is little information to go on. Please also refer to the ['how to as a question'](http://stackoverflow.com/help/how-to-ask) page for some tips. – Gerald Versluis Nov 02 '16 at 12:50
  • Code & Exception Message? – SushiHangover Nov 02 '16 at 12:54
  • No exception message. Please help – Ejaz Nov 02 '16 at 13:05
  • Do a Debug.WriteLine(ex.Message); There needs to be an error message – 476rick Nov 02 '16 at 13:35
  • 1
    Check these questions, it may be why you don't see exceptions: http://stackoverflow.com/questions/17311171/exceptions-not-being-thrown-in-visual-studio http://stackoverflow.com/questions/4560497/exception-window-in-vs-net-2010-is-missing-the-user-unhandled-column – Dennis Schröer Nov 02 '16 at 13:43

1 Answers1

1

You can't load 20 to 100 images in Grid. Mobile phones do not have gigabytes and gigabytes of memories like desktops. You should use ListView only to display more than 4-5 items on screen. When you specify DataTemplate in ListView along with RecycleStrategy, only visible images will be kept in memory and rest will be deallocated automatically.

Also search for GridView kind of controls which supports item recycling.

Akash Kava
  • 39,066
  • 20
  • 121
  • 167