Well, you can't delete a file that's in-use (if indeed it is your program that has it locked, I'd check with something like
Process Explorer - Windows Sysinternals | Microsoft Docs[
^] to see what's using it .... )
ok, so, I see 2 options ...
1) you 'queue' the files you want to delete, maybe write their names to a text file, when your program exits, you spawn a quick program to read the text file's contents being the fully qualified image filenames, and delete them
2) I'm not sure how your program is loading the images, but I would generate a thumb-nail in-memory of an image, and use that in the listview, that way you're not locking the original 'master' on disk
It's interesting that as you've tried,
myListView.ItemsSource = null;
myListView.Items.Clear();
doesnt work, it was my first thought, clear the listview and ?then the lock would go away, but there's obviously something I cant remember about using listview/images