I have a flipview of images, and each flipview item's image is binded to a bitmapimage which is constructed via a URI, e.g.
BitmapImage image = new BitmapImage(new URI(...));
I want the flipview of images to load only images that are selected, so in the flipview_selectionchanged
event, I set the urisource of the selected image, and just make every other BitmapImage.UriSource = null
as long as it's not the selected index. This works perfectly fine.
Also, whenever I instantiate an image, I type the following:
BitmapImage.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
because I want to try to access the file that is associated with that bitmapimage/uri later in my code.
And whenever a user hits this special button, the current selected image in the flipview's file is attempted to be accessed, but then I get a "UnauthorizedAccessException
" for some reason.
I already tried making the current image's UriSource = null
. I say GC.Collect()
as well. But even after doing all of this I still get UnauthorizedAccessException.