WP_Insane
WP_Insane

Reputation: 127

cannot convert from 'System.IO.IsolatedStorage.IsolatedStorageFileStream' to 'Windows.Storage.IStorageFile'

I have document (.doc) stored in IsolatedStorage of my application. I need to open that document in Office application.

After quite long search I coded like below. But it shows error. I need to know How to convert IsolatedStorageFileStream to IStorageFile.

Here's my code:

var file = new IsolatedStorageFileStream(sFile, FileMode.Open, myFile);
await Launcher.LaunchFileAsync(file);

Upvotes: 2

Views: 673

Answers (1)

WP_Insane
WP_Insane

Reputation: 127

Myself found an answer:

var file = await ApplicationData.Current.LocalFolder.GetFileAsync(sFile);
await Launcher.LaunchFileAsync(file);

Upvotes: 2

Related Questions