开发者

Silverlight OOTB Support for 'Save File' browser dialog

I am in t开发者_如何学Gohe design stage of an application that must be both a standalone app & a web application (To save the costs of building 2 near identical applications twice). Basically I have opted to go for a silverlight OOTB application that will be installed on the standalone machines and they will write to a collection of files in the sandbox and occasionally talk to the server version. The same application (with a little configuration) will also operate on the webserver and store its data in a database.

I am however more of a WPF developer so I would like to cover some concerns I have before I go too far down this path...these are:

  1. I hear you can pass a file out for the user to 'Save As' in their browser when using SL normally. Is there similar functionality with OOTB? Because I want to be able to save some of the local files to locations other than the sandbox (With user permission)?

  2. Is is possible to configure OOTB to allow access to the filesystem outside of the sandbox?

  3. Is there a way to programatically determine whether a silverlight application is running in OOTB mode (So I know what mode the application should be running in)?

  4. Are there any major flaws in my ideas so far that would prevent this from being a possibility?


Silverlight 4 will provide support for out of browser trusted applications, which have more privileges that a normal sandboxed application but still not as much as a regular desktop application. Regarding file access, a trusted application will be able to access to some predefined folders such as MyDocuments, MyMusic, MyPictures, MyVideos, but not the entire filesystem. See here for details: http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2009/11/18/silverlight-4-rough-notes-trusted-applications.aspx

As for how to know whether you are running out of browser or not, use Application.Current.RunningOffline.

Finally, I recommend you to take a look at PRISM. Among other things, it eases the task of sharing code between WPF and Silverlight, so you could consider developing a dual SL+WPF application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜