My understanding is that when I set SL5 to run OOB and elevated trust that I should have wide open access to any directory/file on the local system. If an external system places png image files into the user’s c:\images folder, how can I load the various png files into a XAML Image element?
This line works:
image.UriSource = new Uri(value as string);
if I set value to a string like “http://blah.com/image1.png”
But fails if I try to set it to:
ImageUrl = new Uri(@"C:\images\image3.png")
which gets resolved to something like “file:///C:…..” when it hits the
image.UriSource = new Uri(value as string);
line.
How do I display png files in SL5 from any local path on the system running the OOB elevated app?
Something like this should work provided that you have elevated permissions set correctly
If you need to use a uri, this should work:
Note that the paths are different. The uri path requires forward slashes to be used.
You can then set the source of your image control to the bmp
If you’re getting a ‘File Operation not permitted’ exception you need to double check that elevated permissions is checked in your out of browser settings
Project -> Properties -> ‘Out of browser settings’
Check ‘Require elevated trust…’