问题
The SaveFileDialog in Silverlight lacks a DefaultFileName property, resulting in the user having to enter the file name manually with every file download from a Silverlight application.
This is very annoying and there's a lot of criticism about this, see the Silverlight forum.
My question is: what is the most elegant way to get around this?
回答1:
Prepare the download and let aspx handle the download for you:
http://strugglesofacoder.blogspot.com/2011/03/alternative-to-saving-file-in.html
回答2:
I'll add one suggestion as an anwser myself, which I picked up from the mentioned forum:
Copy the file name to the clipboard so users only have to press Ctrl-V in the dialog.
来源:https://stackoverflow.com/questions/3108324/whats-the-most-elegant-workaround-for-the-lack-of-defaultfilename-in-savefiledi