开发者

Launching other applications in Windows phone 7 Programatically

I am downloading a file from Internet, and I am saving this in IsolatedStorage. and Now I want to Open that file, ie if it is开发者_Python百科 excel we should open a file with excel if excel is installed, or otherwise prompt the user to choose the application to open that file as like in PC windows os, How can we do this.. give me some Idea..


As general rule, there is no way to do what you are describing. The exception to this is for media, for which you can integrate with the Music and Video hub. This would allow you to, for instance, download a movie and then play it in the same way as if it was part of the zune collection, even though it's in IsolatedStorage.

If you want to download office files from the internet you can simply link to them directly by opening them in a WebBrowserTask. The user would then be able to open the file in the relevant office program. So, if you did the follwoing, the file would be opened in Excel:

var wbt = new WebBrowserTask();
wbt.URL = "http://example.com/file.xlsx";
wbt.Show();

This would not allow you to store the file in IsolatedStorage and that may or may not be an issue for you.


Windows Phone applications run in isolation and with very few exceptions cannot interact with other programs. So there's not a way for you to present a program chooser to allow the user to choose another application to launch.


I am pretty sure there are system launchers for different applications. For example, the YouTube application can be launched programatically the way I showed here - basically it is similar to the way Matt showed. Ultimately, each app is launched via a UIX reference (catched here), but there is no public endpoint to open a res URL.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜