Reputation: 13
I am currently using the Prism Library to build a Xamarin.Forms application. Prism provides developers with an interface 'IApplicationStore' that exposes properties. I implement the interface in my application. I was wondering does the Properties dictionary exposed in the interface store data persistently to a user's device or is this data only available whilst the application is open or in the background? The documentation on the Prism Library Github page doesn't really specify this.
Upvotes: 0
Views: 90
Reputation: 3401
Here is the source code of ApplicationStore on Prism repo on Github:
using System.Collections.Generic;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Prism.AppModel
{
public class ApplicationStore : IApplicationStore
{
public IDictionary<string, object> Properties
{
get { return Application.Current.Properties; }
}
public Task SavePropertiesAsync() =>
Application.Current.SavePropertiesAsync();
}
}
So it's just a wrapper around Xamarin.Forms application properties. If you want to persist the properties, just call SavePropertiesAsync() and it should be fine:
Upvotes: 1