What's the most elegant workaround for the lack of DefaultFileName in SaveFileDialog in Silverlight?

十年热恋 提交于 2019-12-23 10:58:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!