I do the following (simplified) in my code :
this.ImageComponent.Source = new BitmapImage(new Uri("myImage.jpg", UriKind.Absolute));
I have a button and when I click it I do the following :
this.ImageComponent.Source = new BitmapImage(new Uri("anotherImage.jpg", UriKind.Absolute));
System.IO.File.Delete("myImage.jpg");
But I have an exception on the delete, it says it can access the file because it is used by another process. (I've tried with full and relative path).