Menu
  • HOME
  • TAGS

Migrating contents of Windows Phone 7.5 IsolatedStorage to Windows Phone 8.1

windows-phone-8,windows-phone,isolatedstorage

The isolated storage folder is exposed via Windows Runtime as the LocalFolder. You access it the same way in Windows Phone 8 Silverlight apps and in Windows Phone Runtime apps. StorageFolder localFolder = ApplicationData.Current.LocalFolder; No migration is necessary. So long as your new app is published as an update to...

Saving an array in Windows Phone 7 Xna

arrays,windows-phone-7,xna,isolatedstorage,xmlserializer

This should do: private static void DoSaveGame(StorageDevice device) { // Create the data to save. SaveGameData data = new SaveGameData(); data.PlayerName = "Hiro"; data.AvatarPosition = new Vector2(360, 360); data.Level = 11; data.Score = 4200; // Open a storage container. IAsyncResult result = device.BeginOpenContainer("StorageDemo", null, null); // Wait for the WaitHandle...

WP 8.1 - How to save an image to Isolated Storage if know it's URL

c#,image,windows-phone,windows-phone-8.1,isolatedstorage

Don't forget to change 'imagefile' path and fileContent variable. private async void SaveFile() { try { StorageFolder folder = ApplicationData.Current.LocalFolder; if(folder != null) { StorageFile file = await folder.CreateFileAsync("imagefile", CreationCollisionOption.ReplaceExisting); byte[] fileContnet = null; // This is where you set your content as byteArray Stream fileStream = await file.OpenStreamForWriteAsync(); fileStream.Write(fileContent,...

How to save IsolatedStorageSettings key to a string

c#,string,isolatedstorage,unhandled-exception

if (IsolatedStorageSettings.ApplicationSettings.Contains("key") && IsolatedStorageSettings.ApplicationSettings["key"] != null) { string GetKey = IsolatedStorageSettings.ApplicationSettings["key"].ToString(); } Try like this ! Probably key is null....

Difference between LocalSettings and IsolatedStorageSettings

windows-phone-8.1,isolatedstorage,application-data

The difference between Windows.Storage.ApplicationData.Current.LocalSettings and IsolatedStorageSettings.ApplicationSettingsis that the first one is the newer unified Windows Store App API whereas the latter is from the "old" Silverlight API. New is not always better but I personally think you should go with the modern version here. Both work with Silverlight but if...

Create playlist (BackgroundAudio) from database or from isolated storage c# Windows Phone

database,windows-phone-8,isolatedstorage,playlist,background-audio

This isn't a complete solution but you can read this article on how to call the database from C# classes here: http://msdn.microsoft.com/en-us/library/bb655883(v=vs.90).aspx and I'm betting that one of those returns a List of data objects.

Windows Phone 7: Decrypting many files from isolated storage

c#,windows-phone-7,encryption,isolatedstorage

Xaml: <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <StackPanel> <Button Content="Write Random File" Click="WriteFile" VerticalAlignment="Top" /> <Button Content="Read files File" Click="ReadFiles" VerticalAlignment="Top" /> </StackPanel> </Grid> Code: public partial class MainPage : PhoneApplicationPage { // Constructor public MainPage() { InitializeComponent(); } private const string FilePath = "{0}.txt"; private readonly List<ItemView> items = new List<ItemView>();...

Writing ObservableCollection to file

c#,windows-phone-8,observablecollection,isolatedstorage,longlistselector

Thanks for the help. I solved my issue with the following code: string[] contenutoStorico = rigaStorico.Select(x => x.Name).ToArray(); IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication(); using (StreamWriter writeFile = new StreamWriter(new IsolatedStorageFileStream("history.txt", FileMode.Create, FileAccess.Write, myIsolatedStorage))) { for (int i = 0; i < contenutoStorico.Length; i++) { writeFile.WriteLine(contenutoStorico[contenutoStorico.Length-i-1]); } writeFile.Close(); } ...

Local Database for Windows Phone 8

c#,windows-phone-8,linq-to-sql,sql-server-ce,isolatedstorage

SQL CE uses it's own methods to store the database within isolated storage. If you want to use SQL CE with linq, then you need to define your model classes as a System.Data.Linq.Table object, which will be placed in a class of type System.Data.Linq.DataContext. Calling SubmitChanged on the DataContext will...

declaring key in IsolatedStorageSettings

windows-phone-8,isolatedstorage

If you want to load your count every time the App is Launched then put your code in Application_Launching event in App.xaml.cs: // declare static variable which you will be able to access from anywhere public static int count; private void Application_Launching(object sender, LaunchingEventArgs e) { IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;...

System.InvalidCastException with string isolatedstorage

c#,visual-studio-2012,exception-handling,isolatedstorage

I had the same problem! Here is what I did: if (IsolatedStorageSettings.ApplicationSettings.Contains("0")) { string temp = IsolatedStorageSettings.ApplicationSettings["0"].ToString(); } ...

Reading from / Writing into a Text file in WP8 App

c#,file,xaml,windows-phone-8,isolatedstorage

So, I tried somethings on my own and came up with a solution to my problem. Well the Data File handling mechanism in C# is pretty "intelligent" and the approach used for a WP8 App is similar to that of a Console Application. We use the System.IO namespace along with...

Writing to file in project folder - Operation not permitted

c#,json,windows-phone-8,isolatedstorage

Can't you just use: IsolatedStorageFile isoFile; isoFile = IsolatedStorageFile.GetUserStoreForApplication(); // Open or create a writable file. IsolatedStorageFileStream isoStream = new IsolatedStorageFileStream("Common/DataModel/EventsData.json", FileMode.OpenOrCreate, FileAccess.Write, isoFile); StreamWriter writer = new StreamWriter(isoStream); ...

How to convert isolated memory into File Storage in C#?

c#,filestream,isolatedstorage

Following example shows how you could read a text file within IsolatedStorage and write to a specific location, string fileContent = string.Empty; //Read file within IsolatedStorage using (IsolatedStorageFile storage = IsolatedStorageFile.GetStore((IsolatedStorageScope.Domain | IsolatedStorageScope.Assembly | IsolatedStorageScope.User), null, null)) { using (StreamReader reader = new StreamReader(storage.OpenFile("ReadMe.txt", FileMode.Open))) { fileContent = reader.ReadToEnd(); }...

How do you upload Isolated Storage files when submitting WP8 app to Windows Store?

windows-phone-8,isolatedstorage

Some info about Content files (static files) If you have static files - that is, files that do not change once the app is deployed except on update of the app - you put these files in the app as Content. You add them in VS and set their "Build...

How too look what is in the Isolated Storage (windows phone)?

c#,windows-phone-8,isolatedstorage

There's a very handy tool for viewing the files currently in the isolated storage. Here's a link. However, if you're planning on doing this at runtime, then I would suggest checking the following tutorial from MSDN, here This method in particular may be what you are after. public static List<String>...

More than one instance of IsolatedStorageSettings?

c#,windows-phone-8,isolatedstorage,application-settings,isolatedstoragefile

Check out this article on MSDN IsolatedStorageSettings.ApplicationSettings Property as it clearly state Gets an instance of IsolatedStorageSettings that contains the contents of the application's IsolatedStorageFile, scoped at the application level, or creates a new instance of IsolatedStorageSettings if one does not exist. so it is not possible to create more...

How to use IsolatedStorage in a C# Console Application

c#,c#-4.0,openxml,isolatedstorage,isolatedstoragefile

This is pretty straight-forward. As per MSDN: All assemblies associated with an application use the same isolated store when using this method. This method can be used only when the application identity can be determined - for example, when the application is published through ClickOnce deployment or is a Silverlight-based...

Is it possible to navigate with a webBroser object to an isolated storage folder in WPF

c#,wpf,webbrowser-control,isolatedstorage,isolatedstoragefile

What we've finally used is this piece of code: Uri url = new Uri("file:///" + rootdir + uri.ToString(), UriKind.Absolute); this.wbControl.Navigate(url); where rootdir is got by the following method: public string GetRootDir() { Type type = isoStore.GetType(); FieldInfo field = type.GetField("m_RootDir", System.Reflection.BindingFlags.NonPublic | BindingFlags.Instance); string rootDir = field.GetValue(isoStore).ToString(); return rootDir; }...

all elments duplicated on adding new element in XML

c#,xml,windows-phone-8,isolatedstorage,isolatedstoragefile

It looks like what's happening here is that you are opening the stream with FileMode.Open, reading to the end of the stream to read in the XML document, and then writing to that stream starting at that point. So that's why you are encountering this duplication. I suggest reading in...

A change in one object changes the second one too

c#,windows-phone-8,isolatedstorage

So, basically lstUsers and tmpLstUsers are references to the same object. All you have to do is to create a new one and copy content from the original. If you need a quick solution, then you can do it like this (code below). I just guess that ArrayOfClsSimpleData is some...