How to store App settings in Xamarin.Forms

后端 未结 4 2075
攒了一身酷
攒了一身酷 2020-12-05 09:59

How can we store and retrieve App settings as key,value pair in Xamarin.Forms? Like when the app is closed we can store the user preferences and on restarting of the App we

4条回答
  •  一个人的身影
    2020-12-05 10:06

    The Application object (in VS you get an App class that inherits from it, I think the Xamarin Studio template might be slightly different) has a Properties dictionary that is specifically for this. If you need to make sure your properties get saved right away, there is a Application.SavePropertiesAsync method you can call.

提交回复
热议问题