public void Save(Person person)
        {
            var defaults = NSUserDefaults.StandardUserDefaults;
            defaults.SetString(person.FirstName, "firstName");
            defaults.SetString(person.LastName, "lastName");
            defaults.SetInt(person.Age, "age");

            defaults.Synchronize();
        }
        public void Save(Person person)
        {
            var preferences = PreferenceManager.GetDefaultSharedPreferences(_context);
            var editor = preferences.Edit();
            editor.PutString("fname", person.FirstName);
            editor.PutString("lname", person.LastName);
            editor.PutInt("age", person.Age);

            editor.Commit();
        }
        public Person Read()
        {
            var defaults = NSUserDefaults.StandardUserDefaults;
            var person = new Person();
            person.FirstName = defaults.StringForKey("firstName");
            person.LastName = defaults.StringForKey("lastName");
            person.Age = defaults["age"] == null ? int.MinValue : (int)defaults.IntForKey("age");

            return person;
        }
        void SaveButton_Click(object sender, EventArgs e)
        {
            var person = new Person();
            person.FirstName = FirstName.Text;
            person.LastName = LastName.Text;
            person.Age = int.Parse(Age.Text);

            _storageService.Save(person);
            _dialogService.ShowAlert("Info", "Save Complete");
        }
        public Person Read()
        {
            var person = new Person();
            var prefs = PreferenceManager.GetDefaultSharedPreferences(_context);

            person.FirstName = prefs.GetString("fname", string.Empty);
            person.LastName = prefs.GetString("lname", string.Empty);
            person.Age = prefs.GetInt("age", int.MinValue);

            return person;
        }