I found a solution to my problem and I'm going to put this answer as a community wiki.
As expected, I wasn't able to access file system, show SaveFileDialog
or save the image to the clipboard due to the partial-trust security limitations.
So, I've created an .ashx handler on the site, from which my XBAP application is deployed, which receives a certain image id in the URL string, queries the image from the DB, and returns the image (context.WriteBinary
) under the proper content header "image/jpeg".
In my XBAP, instead of the Image
control I've put the WebBrowser
control, provided with the proper URI (you might need a trick to bind the Source property). You can only specify an URI that is pointing to the site of origin of your XBAP app. It can be an absolute path, or it can use the special syntax including pack://siteoforigin:,,
Voila, now the picture supports the standard browser context menu with "Save...", "Set as background" and all the other useful elements :-)