I have folder full of pngs. I add all the pngs to the the carousel and then after viewing those in Carousel, I need to delete those from my hard disk. But it gives me an error saying the files are still used by the carousel. How do delete the image source??
3 Answers, 1 is accepted
answered on 24 Jul 2012, 03:53 PM
You can clear the source of the carousel and remove the images after that.
foreach (string png inDirectory.GetFiles(output))
Image myimage = newImage();
var uri = newUri(png);
myimage.Source = newBitmapImage(uri);
myimage.Height = 200;
myimage.Width = 200;
MyCarousel.ItemsSource = myImages;
To release the files used in carousel, I am doing following
MyCarousel.ItemSource = null;
but still when I delete the pngs in a output folder, I get an exception saying pngs are being used by another process
which is this RadCarousel.
answered on 25 Jul 2012, 07:52 AM
Could you take a look at this forum thread and follow the ideas illustrated in the threads mentioned there ? Do you still get the same exception ?